Juniper / open-register-design-tool

Tool to generate register RTL, models, and docs using SystemRDL or JSpec input
Apache License 2.0
195 stars 69 forks source link

Reset terms are not the correct width #66

Closed sjalloq closed 5 years ago

sjalloq commented 5 years ago

I found one example of a register reset term not being the correct width. This might be a case of me using a generic single bit field definition and expanding that in the reg fefinition.

In the following RDL, the register _vendor is the correct with of 8-bits but its reset term is 1'b0.

field interrupt_enable {
      hw=na ;         // Hardware has no access
      sw=rw ;         // Software can read/write
      reset = 1'b0 ;  // Reset value is zero
};

reg irq_en_reg_8 { 
    regwidth = 16 ;

    name = "SFF-8636 Interrupt Enable Flags Byte 8" ;
    desc = "These interrupts are vendor specific" ;

    interrupt_enable _vendor[8] ;
};
sdnellen commented 5 years ago

Yes, tool currently doesn't resize the width of reset constant once the width is set in the field def assign. For this case could try using int assign, ie reset = 0; (have not tested)

sjalloq commented 5 years ago

Thanks. That didn't work so I'll stick it inside a for loop.