Skip to content

class Memory: add reset_less parameter that will not initialize memories with 0 value in generated RTL. #270

Open
@nmigen-issue-migration

Description

@nmigen-issue-migration

Issue by Fatsie
Saturday Nov 16, 2019 at 13:21 GMT
Originally opened as m-labs/nmigen#270


I am using nmigen for generating RTL to be implemented on an ASIC. In an ASIC the content of a memory block is random at startup. Currently generated RTL by nmigen initializes memories by default with 0, which does not match behavior of a memory on an ASIC.
I am using external simulators and not pysim as my designs currently contain external verilog and VHDL code.
Some comments on the code:

  • I named the parameter reset_less after the same parameter name for Signal. I am open for suggestion for other/better name.
  • I added some unit test code but the feature would actually only be tested fully when generated rtlil code is read into yosys. Did not know how to best implement that in the nmigen unit test framework.
  • For pysim it may be good if memories could be initialized with random values if reset_less is set to True. I suppose pysim does not want to support 'X' or 'U' values for signals.

Fatsie included the following code: https://github.com/m-labs/nmigen/pull/270/commits

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions