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

generates wrong sized initializations on its own generated localparams #301

Open
pbreuer opened this issue Dec 21, 2024 · 2 comments
Open

Comments

@pbreuer
Copy link

pbreuer commented Dec 21, 2024

I'm seeing a lot of:

        // removed localparam type sv2v_uu_icache_SelHPTW
        localparam [0:0] sv2v_uu_icache_ext_SelHPTW_0 = 1'sb0;
        localparam sv2v_uu_icache_WORDLEN = 32;
        // removed localparam type sv2v_uu_icache_ByteMask
        localparam [3:0] sv2v_uu_icache_ext_ByteMask_0 = 1'sb0;
        localparam sv2v_uu_icache_LOGBWPL = AHBWLOGBWPL;

I don't know exactly what is going on here but the initialization constants are the wrong size for some of these declarations, as seen above for [3:0].

Regards

PTB

@zachjs
Copy link
Owner

zachjs commented Dec 22, 2024

Thank you for filing this issue! For these localparams, sv2v relies on the sign and size extension of assignment like contexts defined in the Verilog standard to simplify its conversion. That is,

localparam [3:0] sv2v_uu_icache_ext_ByteMask_0 = 1'sb0;

is behaviorally equivalent to

localparam [3:0] sv2v_uu_icache_ext_ByteMask_0 = 3'b000;

Do you agree? If not, what am I missing?

@pbreuer
Copy link
Author

pbreuer commented Dec 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants