pkd
Junior Member
![* *](https://designers-guide.org/forum/Templates/Forum/default/starblue.gif)
Offline
Posts: 25
India
|
Dear all, I am facing this error while compiling the code below for an ADC which is an exact copy of VerilogA manual downloaded from this forum only.Here is the error: Quote:Error found by spectre during SpectreHDL compile. "/home/pratap/cadence/designs/verilogA_try/adc/veriloga/veriloga.va", line 14: "genvar <<--? i;" "/home/pratap/cadence/designs/verilogA_try/adc/veriloga/veriloga.va", line 14: Error: genvars are not yet supported Here is the source code in verilog-A... Code:// VerilogA for verologA, adc, veriloga
`include "constants.vams"
`include "disciplines.vams"
module adc(in, clk, out);
parameter bits = 8, fullscale = 1.0, dly = 0, ttime = 10n;
input in, clk;
output [0:bits-1] out;
electrical in, clk;
electrical [0:bits-1] out;
real sample, thresh;
integer result[0:bits-1];
genvar i;
analog begin
@(cross(V(clk)-2.5, +1)) begin
sample = V(in);
thresh = fullscale/2.0;
for (i = bits - 1; i >= 0; i = i - 1) begin
if (sample > thresh) begin
result[i] = 1.0;
sample = sample - thresh;
end
else begin
result[i] = 0.0;
end
sample = 2.0*sample;
end
end
for (i = 0; i < bits; i = i + 1) begin
V(out[i]) <+ transition(result[i], dly, ttime);
end
end
endmodule
Please let me know if I am doing something wrong or if I am missing some thing. Thanks, -pkd
|