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

repeated #includes #8

Open
uzleosharif opened this issue Jan 8, 2023 · 2 comments
Open

repeated #includes #8

uzleosharif opened this issue Jan 8, 2023 · 2 comments
Assignees
Labels

Comments

@uzleosharif
Copy link

not really an issue but would be nice if this could be resolved. Issue is if the RDL file instantiates k>1 instances of a regfile def then we get corresponding k #includes. For example, consider

    regfile i2c_channel  {
        reg {
            name = "RX_SADDR";
            desc = "uDMA RX I2C buffer base address configuration register.";
            regwidth=32;
             field {
                name = "RX_SADDR";
                fieldwidth = 32;
            } RX_SADDR =0;
        } RX_SADDR @0x0;
        reg {
            name = "RX_SIZE";
            desc = "uDMA RX I2C buffer size configuration register.";
            regwidth=32;
             field {
                name = "RX_SIZE";
                fieldwidth = 32;
            } RX_SIZE =0;
        } RX_SIZE @0x4;
        reg {
            name = "RX_CFG";
            desc = "uDMA RX I2C stream configuration register.";
            regwidth=32;
            field {
                name = "CLR";
            } CLR[6:6] =0;
            field {
                name = "PENDING";
            } PENDING[5:5] =0;
            field {
                name = "EN";
            } EN[4:4] =0;
            field {
                name = "DATASIZE";
            } DATASIZE[2:1] =0;
            field {
                name = "CONTINOUS";
            } CONTINOUS[0:0] =0;
        } RX_CFG @0x8;
        reg {
            name = "TX_SADDR";
            desc = "uDMA TX I2C buffer base address configuration register.";
            regwidth=32;
            field {
                name = "TX_SADDR";
                fieldwidth = 32;
            } TX_SADDR =0;
        } TX_SADDR @0x10;
        reg {
            name = "TX_SIZE";
            desc = "uDMA TX I2C buffer size configuration register.";
            regwidth=32;
            field {
                name = "TX_SIZE";
                fieldwidth = 32;
            } TX_SIZE =0;
        } TX_SIZE @0x14;
        reg {
            name = "TX_CFG";
            desc = "uDMA TX I2C stream configuration register.";
            regwidth=32;
            field {
                name = "CLR";
            } CLR[6:6] =0;
            field {
                name = "PENDING";
            } PENDING[5:5] =0;
            field {
                name = "EN";
            } EN[4:4] =0;
            field {
                name = "DATASIZE";
            } DATASIZE[2:1] =0;
            field {
                name = "CONTINOUS";
            } CONTINOUS[0:0] =0;
        } TX_CFG @0x18;
        reg {
            name = "CMD_SADDR";
            desc = "uDMA CMD I2C buffer base address configuration register.";
            regwidth=32;
            field {
                name = "CMD_SADDR";
                fieldwidth = 32;
            } CMD_SADDR =0;
        } CMD_SADDR @0x20;
        reg {
            name = "CMD_SIZE";
            desc = "uDMA CMD I2C buffer size configuration register.";
            regwidth=32;
            field {
                name = "CMD_SIZE";
                fieldwidth = 32;
            } CMD_SIZE = 0;
        } CMD_SIZE @0x24;
        reg {
            name = "CMD_CFG";
            desc = "uDMA CMD I2C stream configuration register.";
            regwidth=32;
            field {
                name = "CLR";
            } CLR[6:6] =0;
            field {
                name = "PENDING";
            } PENDING[5:5] =0;
            field {
                name = "EN";
            } EN[4:4] =0;
            field {
                name = "DATASIZE";
            } DATASIZE[2:1] =0;
            field {
                name = "CONTINOUS";
            } CONTINOUS[0:0] =0;
        } CMD_CFG @0x28;
        reg {
            name = "STATUS";
            desc = "uDMA I2C Status register.";
            regwidth=32;
            field {
                name = "ACK";
            } ACK[2:2] =0;
            field {
                name = "ARB_LOST";
            } ARB_LOST[1:1] =0;
            field {
                name = "CONTINOUS";
            } BUSY[0:0] =0;
        } STATUS @0x30;
        reg {
            name = "SETUP";
            desc = "uDMA I2C Configuration register.";
            regwidth=32;
            field {
                name = "DO_RST";
            } DO_RST[0:0] =0;
        } SETUP @0x34;
    } i2c0 @0x180;


    i2c_channel  i2c1 @0x200;

as seen i2c_channel is instantiated twice. In the generated header, we correspondingly get

// ...
#include "i2c_channel.h"
#include "i2c_channel.h"
// ...

perhaps the 2nd #include in above could be avoided

@eyck eyck added the bug label Jan 8, 2023
@eyck eyck self-assigned this Jan 8, 2023
@eyck
Copy link
Contributor

eyck commented Jan 8, 2023

Where did you encounter the doubled #include ?

@uzleosharif
Copy link
Author

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

No branches or pull requests

2 participants