diff options
| author | Carlos Eduardo | 2021-04-07 16:01:51 -0300 |
|---|---|---|
| committer | GitHub | 2021-04-07 19:01:51 +0000 |
| commit | e0da5ae47f3674bdd2018a672028290c927274e1 (patch) | |
| tree | f58135f5b2b97a77c8ba0e59f420c20d0b85e978 /docs/src/explanations | |
| parent | d3e2b346d4edfb3f380e4d8dbfc96b540791275e (diff) | |
Add documentation guide about memory initialization (#1850)
* Add documentation guide about memory initialization
* Move information to experimental and add ref
Diffstat (limited to 'docs/src/explanations')
| -rw-r--r-- | docs/src/explanations/memories.md | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/docs/src/explanations/memories.md b/docs/src/explanations/memories.md index 792d176e..09ac4c8d 100644 --- a/docs/src/explanations/memories.md +++ b/docs/src/explanations/memories.md @@ -11,9 +11,11 @@ Chisel provides facilities for creating both read only and read/write memories. ## ROM Users can define read only memories with a `Vec`: + ```scala mdoc:invisible import chisel3._ ``` + ``` scala mdoc:compile-only VecInit(inits: Seq[T]) VecInit(elt0: T, elts: T*) @@ -56,6 +58,7 @@ If the same memory address is both written and sequentially read on the same clo Values on the read data port are not guaranteed to be held until the next read cycle. If that is the desired behavior, external logic to hold the last read value must be added. #### Read port/write port + Ports into `SyncReadMem`s are created by applying a `UInt` index. A 1024-entry SRAM with one write port and one read port might be expressed as follows: ```scala mdoc:silent @@ -79,9 +82,11 @@ class ReadWriteSmem extends Module { Below is an example waveform of the one write port/one read port `SyncReadMem` with [masks](#masks). Note that the signal names will differ from the exact wire names generated for the `SyncReadMem`. With masking, it is also possible that multiple RTL arrays will be generated with the behavior below. - + + #### Single-ported + Single-ported SRAMs can be inferred when the read and write conditions are mutually exclusive in the same `when` chain: ```scala mdoc:silent @@ -110,7 +115,7 @@ class RWSmem extends Module { Here is an example single read/write port waveform, with [masks](#masks) (again, generated signal names and number of arrays may differ): - + ### `Mem`: combinational/asynchronous-read, sequential/synchronous-write @@ -174,3 +179,9 @@ class MaskedRWSmem extends Module { } ``` +### Memory Initialization + +Chisel memories can be initialized from an external `binary` or `hex` file emitting proper Verilog for synthesis or simulation. There are multiple modes of initialization. + +For more information, check the experimental docs on [Loading Memories](../appendix/experimental-features#loading-memories) feature. + |
