bespoke-silicon-group / bsg_manycore

Tile based architecture designed for computing efficiency, scalability and generality
Other
214 stars 56 forks source link

Fixing enum typecast #690

Closed dpetrisko closed 1 year ago

dpetrisko commented 1 year ago

Minor change, VCS accepts it but Verilator and Xcelium do not.

By IEEE, I think the expression gets demoted to logic by the intermediate values, but I haven't delved in the specs about it

taylor-bsg commented 1 year ago

Hm … what are the error messages? What are the types of each of the inputs to the ternary?

On Wed, Jan 25, 2023 at 11:46 PM Dan Petrisko @.***> wrote:

Minor change, VCS accepts it but Verilator and Xcelium do not.

By IEEE, I think the expression gets demoted to logic by the intermediate values, but I haven't delved in the specs about it

You can view, comment on, or merge this pull request online at:

https://github.com/bespoke-silicon-group/bsg_manycore/pull/690 Commit Summary

File Changes

(1 file https://github.com/bespoke-silicon-group/bsg_manycore/pull/690/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/bespoke-silicon-group/bsg_manycore/pull/690, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFG5ABSAN7JSP5B6NIK3H3WUITUBANCNFSM6AAAAAAUHGFGRU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dpetrisko commented 1 year ago
%Error-ENUMVALUE: <PATH>/zynq-parrot/cosim/import/bsg_manycore/v/vanilla_bean/vanilla_core.v:1638:17: Illegal implicit conversion to enum 'bsg_vanilla_pkg::frm_e' from 'logic[2:0]' (IEEE 1800-2017 6.19.3)
                                                                                                                                : ... In instance top.top_fpga_inst.DUT.py[0].podrow.px[0].pod.mc_y[0].mc_x[0].mc.y[0].x[0].tile.proc.h.z.vcore
                                                                                                                                : ... Suggest use enum's mnemonic, or static cast
 1638 |   assign fpu_rm = (id_r.instruction.funct3 == eDYN)
frm_e fpu_rm;
  assign fpu_rm = frm_e'((id_r.instruction.funct3 == eDYN) // logic [2:0]
    ? frm_r // frm_e
    : id_r.instruction.funct3); // logic [2:0]

FWIW, I have had to make similar changes to BP to fix XSIM compatibility over the years, where old versions would segfault with no error (very fun). enum implicit casting seems to be an edge case for lots of tools