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

[BUG] reg after external mem is only generated if not in regfile or addrmap #115

Open
1 task done
paul-demo opened this issue Jul 10, 2024 · 0 comments
Open
1 task done

Comments

@paul-demo
Copy link

paul-demo commented Jul 10, 2024

In an addrmap with some external memories followed by some registers, peakRDL-regblock only generates the registers if they are "loose" members of the addrmap scope. If the registeres are nested inside a regfile or addrmap scope, as shown below, then they quietly do not get generated!

See the example here (please correct me if I am wrapping bah and baz registers incorrectly in a regfile). The syntax is allowed but nothing gets generated after the external memory interfaces. If you comment out regfile my_regfile{} surrounding bah and baz, then it generates all four elements as expected (foo, bar, bah, baz).


addrmap reg_after_exteranl_mem_issue #(
    longint N = 64,
    longint W = 32
) {
    desc = "https://github.com/SystemRDL/PeakRDL-regblock/issues/115";

    default regwidth = W;
    default accesswidth = W;
    default addressing = compact;
    default reset = 0;
    default sw = rw;
    default hw = rw;
    default memwidth = W;
    default mementries = N;

    // External mems
    external mem {
        reg {
            desc = "foo";
            field {} value[W];
        } queue[N];
    } foo %= 0x1000;

    external mem {
        reg {
            desc = "bar";
            field {} value[W];
        } queue[N];
    } bar %= 0x1000;

    // Registers
    // WRAPPING THESE REGISTERS IN A REGFILE OR ADDRMAP CAUSES THEM NOT TO BE GENERATED
    // THEY ONLY GET GENERATED IF YOU COMMENT OUT `regfile my_regfile{}` ENCAPSULATION.
    regfile my_regfile {
    
    reg {
        desc = "bah";
        field {
            hw = r;
            desc = "bah";
        } value[W];
    } bah[2] @ 0xF000;

    reg {
        desc = "baz";
        field {
            hw = r;
            desc = "baz";
        } value[W];
    } baz[2] %= 0x80;

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

No branches or pull requests

1 participant