Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verilator hangs up on circular macro definition #443

Closed
veripoolbot opened this issue Feb 23, 2012 · 3 comments
Closed

verilator hangs up on circular macro definition #443

veripoolbot opened this issue Feb 23, 2012 · 3 comments
Assignees
Labels
area: parser Issue involves SystemVerilog parsing resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Alex Solomatnikov
Original Redmine Issue: 443 from https://www.veripool.org
Original Date: 2012-02-23
Original Assignee: Wilson Snyder (@wsnyder)


Test case:

`define CSR_LOCAL_ADDR_WIDTH  12
`define CSR_SUBMOD_SEL_NUM_BITS `CSR_LOCAL_ADDR_WIDTH-`CSR_SUBMOD_SEL_NUM_BITS +: `CSR_SUBMOD_SEL_NUM_BITS
`define CSR_SUBMOD_SEL_BITS     `CSR_LOCAL_ADDR_WIDTH-`CSR_SUBMOD_SEL_NUM_BITS +: `CSR_SUBMOD_SEL_NUM_BITS
`define CSR_SUBMOD_ADDR_BITS    0 +: `CSR_LOCAL_ADDR_WIDTH-`CSR_SUBMOD_SEL_NUM_BITS

typedef   logic [`CSR_LOCAL_ADDR_WIDTH-1:0]  csr_laddr_t;
typedef   logic [64-1:0]                     csr_data_t;

module mod_a
  (
    output csr_data_t                 csr_rdata_out,

    input logic                       csr_en_in,
    input logic                       csr_we_in,
    input csr_laddr_t                 csr_addr_in,
    input csr_data_t                  csr_wdata_in,
    );

endmodule

module mod_b
  (
    output csr_data_t                 csr_rdata_out,

    input logic                       csr_en_in,
    input logic                       csr_we_in,
    input csr_laddr_t                 csr_addr_in,
    input csr_data_t                  csr_wdata_in,
    );

    mod_a u_mod_a(.csr_en_in  (csr_en_in && (csr_addr_in[`CSR_SUBMOD_SEL_BITS] == 7)),
                  .csr_addr_in(csr_laddr_t'(csr_addr_in[`CSR_SUBMOD_ADDR_BITS])),
                  .* );

endmodule // mod_b

verilator never exits.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-02-24T02:54:55Z


The verilog preprocessor must be one of the most complicated things I've worked on relative to how simple one would think it should be.

Anyhow, there was a warning for this sort of thing, but it wasn't working due to the nature of expansion. Fixed in git towards 3.832. Also affects Verilog-Perl; fixed in git towards 3.314.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-02-27T13:35:01Z


In Verilog-Perl 3.314.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-03-08T04:08:00Z


In 3.832.

@veripoolbot veripoolbot added area: parser Issue involves SystemVerilog parsing resolution: fixed Closed; fixed labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: parser Issue involves SystemVerilog parsing resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants