ibex icon indicating copy to clipboard operation
ibex copied to clipboard

Enum assignment cast

Open towoe opened this issue 7 years ago • 6 comments

In the following lines the enum types are assigned with a value without an explicit cast https://github.com/lowRISC/ibex/blob/93b0b77f2717a69f87608929f7cde9d5268ca2e8/rtl/ibex_controller.sv#L159

https://github.com/lowRISC/ibex/blob/93b0b77f2717a69f87608929f7cde9d5268ca2e8/rtl/ibex_controller.sv#L162

towoe avatar May 10 '19 10:05 towoe

Hi @towoe , thanks for reporting the issue. I am currently fixing and testing it.

vogelpi avatar May 10 '19 12:05 vogelpi

Allright, I fixed it and Vivado does not complain anymore. The patch ended up in pull request #32 . To get it working locally before the pull request is merged, you can just replace the RHS of the two assignments by exc_cause_e'('0); See here: https://github.com/lowRISC/ibex/pull/32/commits/354fe2ddb86070f56e2eb2aad712de3d1ef49137

vogelpi avatar May 10 '19 12:05 vogelpi

Thanks @vogelpi for the fix!

towoe avatar May 10 '19 13:05 towoe

Hi. The same issue is true for the following line: https://github.com/lowRISC/ibex/blob/93b0b77f2717a69f87608929f7cde9d5268ca2e8/rtl/ibex_cs_registers.sv#L376

ikarageo avatar May 11 '19 00:05 ikarageo

Hi @ikarageo , thanks for reporting this issue. The corresponding statement should be:

  dcsr_q     <= '{
    xdebugver: x_debug_ver_e'('0),
    cause:     dbg_cause_e'('0),
    prv:       PRIV_LVL_M,
    default:   '0
  };

vogelpi avatar May 13 '19 11:05 vogelpi

I created a seperate PR #35 to merge the fixes into upstream soon.

vogelpi avatar May 13 '19 14:05 vogelpi