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

tick-define macro substituted with incorrect value in json5 #33

Open
ghost opened this issue Mar 25, 2019 · 1 comment
Open

tick-define macro substituted with incorrect value in json5 #33

ghost opened this issue Mar 25, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Mar 25, 2019

Following is verilog for which duh-import-verilog-ports incorrectly substitutes tick-define

`define IC_ADDR_SLICE_LHS 3'h7
module DW_apb_i2c (
                   paddr
                   );
   input [`IC_ADDR_SLICE_LHS:0] paddr; 
endmodule

the corresponding json5 generated is as follows

{
  component: {
    vendor: 'sifive',
    library: 'blocks',
    name: 'DW_apb_i2c',
    version: '0.1.0',
    busInterfaces: [],
    addressSpaces: [],
    memoryMaps: [],
    model: {
      views: [],
      ports: {
        $ref: '#/definitions/ports',
      },
    },
    fileSets: {},
    pSchema: {},
  },
  definitions: {
    ports: {
      paddr: '3 h7 + 1',
    },
  },
}
@drom
Copy link
Member

drom commented Mar 25, 2019

Tick-define substitution was fine, but in the following expression

input [3'h7:0] paddr; 

The width of the signal was calculated as "3 h7 + 1"

@drom drom added the bug Something isn't working label Jun 16, 2019
@Ramlakshmi3733 Ramlakshmi3733 self-assigned this Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants