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

Native Async reset support in RtlNetlist? #45

Open
jesseclin opened this issue Mar 15, 2024 · 4 comments
Open

Native Async reset support in RtlNetlist? #45

jesseclin opened this issue Mar 15, 2024 · 4 comments

Comments

@jesseclin
Copy link
Contributor

jesseclin commented Mar 15, 2024

Dear @Nic30:

Do you consider adding native asynchronous reset support with hwtLib compatibility like this in RtlNetlist to make it more ASIC-friendly(IMHO)? Thanks.

@Nic30
Copy link
Owner

Nic30 commented Mar 17, 2024

I propose following solution:

With this you will be using async reset on Units with async reset if you do not override reset in _reg() call.
Would this be sufficient for your case?

I wish I know:

  • Is it common to use sync and async resets for the same register?
  • Should async reset and sync reset value be different?
  • Is it common to use multiple async resets for the same register?
  • Is async reset somehow associated with clock domain and could be the case that there are multiple clock domains which do have own async reset?

@jesseclin
Copy link
Contributor Author

Hi @Nic30:

We prefer to reuse the classes defined in hwtLib for ASIC design without manually converting them to an async reset style. If your solution can provide that, it is very welcome. Thanks.

Also, here are my opinions about your questions for reference:

Is it common to use sync and async resets for the same register?

It is possible, but in our async-reset design style, we usually treat the sync reset as another data signal if needed.

Should the async reset and sync reset values be different?

IMHO, letting users choose either of the reset styles is enough in most cases.

Is it common to use multiple async resets for the same register?

No, we never saw that kind of register in ASIC's standard cell library.

Is async reset somehow associated with the clock domain? It could be the case that multiple clock domains have their own async reset.

Our coding rules for your reference:

  • Different clocks: belong to different clock domain
  • Same clocks but different async resets: belong to different clock domain
  • Same clocks but different sync resets: belong to the same clock domain

@Nic30
Copy link
Owner

Nic30 commented Mar 18, 2024

Hi @jesseclin ,

in this case, lets do this:

  • lets add IS_SYNC to reset interfaces as I suggested earlier, but lets initialize it to NOT_SPECIFIED
  • if reset type is not explicitly specified to True/False, lets query a platform object.
  • Platform is passed to to_rtl* functions and should used to make decisions based on target device properties. Lets add something like defaultResetType = RESET_TYPE.SYNC / .ASYNC there

Example of use:

class Reg(Unit):
    def _config(self):
       self.rst_IS_SYNC = Param(NOT_SPECIFIED) 
    def _declr(self):
        addClkRst(self)
        self.rst.IS_SYNC = self.rst_IS_SYNC

        self.din = Signal()
        self.dout = Signal()._m()

    def _impl(self):
        internReg = self._reg("internReg", BIT, def_val=False)

        internReg(self.din)
        self.dout(internReg)

u = Reg()
print(to_rtl_str(u, rarget_platform=DummyPlatform(defaultResetType = RESET_TYPE.ASYNC)))
# internReg will have async reset as platform specifies

u = Reg()
print(to_rtl_str(u))
# internReg will have sync reset because it is default in DummyPlatform constructor and not overridden  

u = Reg()
u.rst_IS_SYNC = True
print(to_rtl_str(u, rarget_platform=DummyPlatform( defaultResetType = RESET_TYPE.ASYNC)))
# internReg will have sync reset because it uses default reset of component which is explicitly set to be synchronous

Do you see any issue with this approach?

@jesseclin
Copy link
Contributor Author

Hi @Nic30:

Great, and it should be able to fulfill our needs; thanks.

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