crossroadsfpga / pigasus

100Gbps Intrusion Detection and Prevention System
670 stars 75 forks source link

Support non-constexpr widths for extern signals in VTL #14

Closed NAtre closed 2 years ago

NAtre commented 2 years ago

Currently, any extern signals generated by VTL must have widths that are known at VTL compile-time. This prevents us from using "late-binding" constants (i.e., values that are known only when the RTL design itself is compiled) or `include-d parameters (e.g., from struct_s.sv) in the signal list. This change fixes that by treating Python strings passed as Extern::size arguments differently from other types; when this occurs, the compiler simply emits "SIZE-1", allowing arbitrary specification of signal width.

Testing:

sidsahay commented 2 years ago

Looks good.