Don't dump VCD values if unchanged

This commit is contained in:
Jevin Sweval 2022-06-20 17:25:02 -07:00
parent 878f21a647
commit bd23a3b423
1 changed files with 5 additions and 10 deletions

View File

@ -57,19 +57,14 @@ class VCDDump(Dump):
c = "" c = ""
for v in self.variables: for v in self.variables:
try: try:
if v.values[self.cnt + 1] != v.current_value: val = v.values[self.cnt + 1]
c += "b" if val != v.current_value:
c += dec2bin(v.values[self.cnt + 1], v.width) v.current_value = val
c += " " c += f"b{dec2bin(val, v.width)} {v.code}\n"
c += v.code
c += "\n"
except: except:
pass pass
if c != "": if c != "":
r += "#" r += f"#{self.cnt + 1}\n{c}"
r += str(self.cnt+1)
r += "\n"
r += c
return r return r
def generate_date(self): def generate_date(self):