Skip to content

Conversation

@povik
Copy link

@povik povik commented Sep 14, 2023

Per the inquiry in issue #1 I put together a pass to extract memory initialization data into separate files:

    ql_bram_initfile {-read|-write} [-path <dir-path>] [selection]

This pass reads/writes initialization data on QuickLogic BRAM primitives from/to
an external file. The filename is stored in the RAM_INIT_FILE parameter, the
value of which will be generated if not set.

    -read -write
        select a read or write mode

    -path <dir-path>
        set the base directory path relative to which the RAM_INIT_FILE filenames
        are interpreted

I hooked it up as an option in synth_quicklogic:

    -meminit <dir-path>
        write block memory initialization data into files created below
        the specified path (qlf_k6n10f only).

Feel free to suggest better naming.

Some points to discuss:

  • The format of the data: Currently it's 36 bits of hex-encoded data per line.

  • Handling of undef bits: There's no handling of it as of now, so when the data is being written all x-bits are replaced with zero.

  • Retaining of the RAM_INIT parameter: The data in the RAM_INIT parameter is kept on the cells even after being written down into the extra files. One thing to consider is resetting it so that it doesn't take up space in the output BLIF/EDIF/Verilog files. I don't know if resetting it to a fully-sized vector of undef bits will lead to a compressed representation in any of the output formats. Another option is to reset it to a zero-sized value.

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

Successfully merging this pull request may close these issues.

1 participant