- v_stmts.append(" `ifndef SYNTHESIS");
- if transp[p1]:
- v_stmts.append(" #%d;" % sum(ports));
- v_stmts.append(" -> UPDATE_%s;" % pf)
+ v_always[last_always_hdr].append((0, pf, "%sDATA %s memory[%sADDR];" % (pf, assign_op, pf)))
+
+ for always_hdr in sorted(v_always):
+ v_stmts.append(always_hdr[1])
+ triggered_events = set()
+ time_cursor = 0
+ v_always[always_hdr].sort()
+ for t, p, s in v_always[always_hdr]:
+ if time_cursor != t or not p in triggered_events:
+ v_stmts.append(" `ifndef SYNTHESIS")
+ stmt = ""
+ if time_cursor != t:
+ stmt += " #%d;" % (t-time_cursor)
+ time_cursor = t
+ if not p in triggered_events:
+ stmt += (" -> UPDATE_%s;" % p)
+ triggered_events.add(p)
+ v_stmts.append(" %s" % stmt)