pascalkuthe / OpenVAF

An innovative Verilog-A compiler
https://openvaf.semimod.de/
GNU General Public License v3.0
113 stars 15 forks source link

support genvar #132

Open gjcoram opened 1 week ago

gjcoram commented 1 week ago

genvar is a special type of integer variable; it is sometimes used in loops that are unrolled at elaboration time.

genvar g;

for (g = 0; g <=2; g = g+1) begin
    e = V(out[g]) - V(expected[g]);
    V(err) <+ e*e;
end