• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Verilog-A Parser shows an error but simulation runs successfully...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 125
  • Views 11873
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Verilog-A Parser shows an error but simulation runs successfully with 0 errors

ElZorro
ElZorro over 3 years ago

Hello All,

I am trying to use the genvar in a loop.
I am able to run a simulation using the following command: spectre testbench.scs
The results of the simulation are as expected.

The problem/confusion is that I always use the Spectre Syntax Checker (Verilog-A Parser) before running a simulation and in this case it shows an error:

spectre #dpl /dev/null #ahdlfile module_09.va

Error found by spectre during AHDL compile.
ERROR (VACOMP-1191): "module_09.va", line 46: The node array access is out of range. Correct the problem and try again.
ERROR (VACOMP-1191): "module_09.va", line 46: The node array access is out of range. Correct the problem and try again.
ERROR (VACOMP-1191): "module_09.va", line 46: The node array access is out of range. Correct the problem and try again.

Line 46:
V(out[i]) <+ transition(value[i], td, tt);

As I mentioned at the beginning the spectre simulations completes with 0 errors and the results are as expected.

What am I missing in the Spectre Syntax Checker command? I would like to continue using it to check the correct syntax, but in this case it is not working properly.
If I should provide more info, plese let me know.

Additional info:
spectre -W
sub-version 17.1.0.515.isr12

Thank you!

See Verilog-A code below.

`include "constants.vams"
`include "disciplines.vams"

module dut (out, in);

// Parameters
parameter integer width = 8;

// Port Direction
output [width-1:0] out;
input [width-1:0] in;

// Port Type/Discipline
electrical [width-1:0] out;
electrical [width-1:0] in;

parameter real td = 0;
parameter real tt = 1n;

real value [3:0];
genvar i;

analog begin

@(initial_step) begin
value[3] = 3.5;
value[2] = 2.6;
value[1] = 1.7;
value[0] = 0.8;
end

for (i=0; i<=3; i=i+1) begin
V(out[i]) <+ transition(value[i], td, tt);
end

end

endmodule

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    This is an aspect of the fact that Virtuoso doesn't really directly support variable width buses (either in schematics or in Verilog-A models). In older versions of Spectre, the analyser gave errors such as you were seeing. These went away in Spectre18.1 ISR12, but then you hit a different problem that both the shadow database used to store the terminal information, plus any generated symbols end up with the wrong bus width (not even the default value).

    A workaround is to use the approach covered in my article How to create a VerilogA model of a DAC with a variable width bus input

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    This is an aspect of the fact that Virtuoso doesn't really directly support variable width buses (either in schematics or in Verilog-A models). In older versions of Spectre, the analyser gave errors such as you were seeing. These went away in Spectre18.1 ISR12, but then you hit a different problem that both the shadow database used to store the terminal information, plus any generated symbols end up with the wrong bus width (not even the default value).

    A workaround is to use the approach covered in my article How to create a VerilogA model of a DAC with a variable width bus input

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • ElZorro
    ElZorro over 3 years ago in reply to Andrew Beckett

    Thank you for your fast reply Andrew. I will have a look at the provided link.

    Just as a comment or for documentation purposes (I was preparing this before you replied):
    In the example above I wanted to use an Analog Contribution inside the for loop to pass values only to some indexes of the port, in this case to indexes 0 to 3.

    Well, it seems that the Verilog-A Parser doesn't like it and shows an error.
    I would have expected a Warning, not an error because as mentioned in the initial message the simulation runs without problems.

    I did some changes in the code so that I pass values to all the indexes of the port, from 0 to 7, and now the Verilog-A Parser doesn't complain.
    But this is not necessarily what I wanted to do.

    Thank you very much!

    See new code below:


    `include "constants.vams"
    `include "disciplines.vams"

    module dut (out, in);

    // Parameters
    parameter integer width = 8;

    // Port Direction
    output [width-1:0] out;
    input [width-1:0] in;

    // Port Type/Discipline
    electrical [width-1:0] out;
    electrical [width-1:0] in;

    parameter real td = 0;
    parameter real tt = 1n;

    //~ real value [3:0];
    real value [width-1:0];

    genvar i;

    analog begin

    @(initial_step) begin
    value[7] = 7.8;
    value[6] = 6.8;
    value[5] = 5.8;
    value[4] = 4.8;
    value[3] = 3.5;
    value[2] = 2.6;
    value[1] = 1.7;
    value[0] = 0.8;
    end

    //~ for (i=0; i<=3; i=i+1) begin
    for (i=0; i<width; i=i+1) begin
    V(out[i]) <+ transition(value[i], td, tt);
    end

    end

    endmodule

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information