SystemRDL / systemrdl-compiler

SystemRDL 2.0 language compiler front-end
http://systemrdl-compiler.readthedocs.io
MIT License
236 stars 69 forks source link

Nested parameters don't reach leaf instances #12

Closed bdmagnuson closed 6 years ago

bdmagnuson commented 6 years ago

Given this code the fields should have a width of 4. Instead they are taking the default value of the enclosing regfile (i.e. 2)

addrmap nested {

    reg r1 #(longint unsigned WIDTH=1)  {
        field {} f[WIDTH];
    };

    regfile rf1 #(longint unsigned WIDTH=2) {
        reg r2 #(longint unsigned WIDTH=3)  {
            field {} f[WIDTH];
        } #(.WIDTH(WIDTH)) r_inst1;

        r1 #(.WIDTH(WIDTH)) r_inst2;
    };

    rf1 #(.WIDTH(4)) rf_inst;

};
amykyta3 commented 6 years ago

confirmed https://travis-ci.org/SystemRDL/systemrdl-compiler/builds/450118525

bdmagnuson commented 6 years ago

This also looks like it's fixed with my small test case.