Skip to content

Difference between memory arrays and signal arrays in Amaranth #1557

Answered by whitequark
joshkahn42 asked this question in Q&A
Discussion options

You must be logged in to vote

The documentation in the Arrays section says "An array becomes immutable after it is indexed for the first time. The elements of the array do not themselves become immutable, but it is not recommended to mutate them as the behavior can become unpredictable." That seems to indicate I should not use Arrays for my use case?

I think there is a terminology confusion here. The Array becomes immutable in the Python sense: the Python object that is created by the Array() syntax cannot be modified at compilation time any more. The values inside, however, can be modified as usual in the generated gateware.

When I generate verilog code using a Memory Array, the verilog code seems to just be a reg…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@joshkahn42
Comment options

@whitequark
Comment options

Answer selected by joshkahn42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants