Skip to content

standalone generator #6

@uzleosharif

Description

@uzleosharif

I am using the standalone-generator tool for Pulpissimo peripherals. I have a feature request. Currently the tool correctly generates the functional stub for peripheral X having a function registerResources() found in gen/x.h

namespace foo {

class x_regs: 
            public sc_core::sc_module,
            public scc:resetable
{
  // ...
  template<unsigned BUSWIDTH=32>
  void registerResources(scc::tlm_target<BUSWIDTH>& target, uint64_t offset=0);
};

template<unsigned BUSWIDTH>
inline void foo::gen::x_regs::registerResources(scc::tlm_target<BUSWIDTH>& target, uint64_t offset) {
  target.addResource(XYZ, 0x0UL);
  target.addResource(ABC, 0x4UL);
  // ...
}

}

i would request to use offset in implementation like in the following

template<unsigned BUSWIDTH>
inline void foo::gen::x_regs::registerResources(scc::tlm_target<BUSWIDTH>& target, uint64_t offset) {
  target.addResource(XYZ, 0x0UL + offset);
  target.addResource(ABC, 0x4UL + offset);
  // ...
}

if there are strong reasons to avoid this then maybe a CLI switch could be provided (like -ns for namespace) to enable this. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions