pulp-platform / riscv-dbg

RISC-V Debug Support for our PULP RISC-V Cores
Other
198 stars 70 forks source link

[vendor/pulp_riscv_dbg] Possible issue in dm_csrs.sv #69

Closed NilsGraf closed 3 years ago

NilsGraf commented 4 years ago

Reposting OpenTitan issue 2663:

While running LEC on top_earlgrey using script syn_yosys.sh, line 92 of dm_csrs.sv (see below) causes a warning:

localparam dm::dm_csr_e ProgBufEnd = dm::dm_csr_e'((dm::ProgBuf0 + {4'b0, dm::ProgBufSize}));

ProgBuf0 = 8'h20 and ProgBufSize = 5'h8, so the sum is 8'h28, but this constant is not an element of the dm_csr_e enum defined in dm_pkg.sv. So the tool reports a Warning about this.

Suggestion: Instead of above line 92 of dm_csrs.sv, would it make sense to simply add below line between lines 64 and 65 in dm_pkg.sv?

ProgBufEnd = 8'h28,

One more note: Is it correct that ProgBufEnd = ProgBuf0 + ProgBufSize, or should it rather be ProgBufEnd = ProgBuf0 + ProgBufSize - 1?

bluewww commented 3 years ago

Fixed in #84