diff options
| author | azidar | 2015-09-01 16:04:35 -0700 |
|---|---|---|
| committer | azidar | 2015-09-01 16:04:35 -0700 |
| commit | 384ba14de58bcafbdeda43ced8b93d6d479a27ad (patch) | |
| tree | d912950b053f588d77f9ff7eb1ac18546b95499a /spec | |
| parent | d8bf7de8c3b7c3e37716fcbc7afc617213c1561b (diff) | |
Added cases of undefined behavior for cmem and smem
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/spec.tex | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/spec/spec.tex b/spec/spec.tex index d617dd05..87a8dfdf 100644 --- a/spec/spec.tex +++ b/spec/spec.tex @@ -314,27 +314,34 @@ Like wires, registers are also {\em bidirectional}, which means that they can be The onreset statement is used to specify the initialization value for a register, which is assigned to the register when the declared \pds{reset} signal is asserted. +smem +read from same address as write + + \subsection{Memories} A memory is a stateful circuit element containing multiple elements. -Unlike registers, memories can {\em only} be read from or written to through {\em accessors}. +The type for a memory must be completely specified; it cannot contain any unknown widths or bundle types with reverse fields. +Unlike registers, memories can {\em only} be read from or written to through {\em accessors}, and cannot be initialized using a special FIRRTL construct +Instead, the circuit itself must contain the proper logic to initialize the memory. + +Additionally, if a memory is written via two or more accessors to the same memory address, the resulting stored value is undefined. + Memories always have a synchronous write, but can either be declared to be read combinatorially or synchronously. -A synchronously read memory with a given name, type, and size integer can be instantiated with the following statement. +A combinatorially read memory with a given name, type, and size integer can be instantiated with the following statement. \[ \begin{aligned} -\kw{smem} \text{name } \kw{:} \pds{type} , size \\ +\kw{cmem} \text{name } \kw{:} \pds{type} , size\\ \end{aligned} \] -A combinatorially read memory with a given name, type, and size integer can be instantiated with the following statement. +A synchronously read memory with a given name, type, and size integer can be instantiated with the following statement. \[ \begin{aligned} -\kw{cmem} \text{name } \kw{:} \pds{type} , size\\ +\kw{smem} \text{name } \kw{:} \pds{type} , size \\ \end{aligned} \] -The type for a memory must be completely specified; it cannot contain any unknown widths or bundle types with reverse fields. - -A memory cannot be explicitly initialized using a special FIRRTL construct - the circuit itself must contain the proper logic to initialize the memory. +A synchronously read memory has the additional restriction that a read to an address on the same cycle its written returns an undefined value. \subsection{Nodes} A node is simply a named intermediate value in a circuit, and is akin to a pointer in the C programming language. @@ -381,6 +388,8 @@ As mentioned previously, the only way to read from or write to a memory is throu However, accessors are not restricted to accessing memories. They can be used to access {\em any} cmem, smem, or wire/reg with vector-valued type. +An accessor passed a poisoned value as an index writes or reads a poisoned value. + \subsection{Instances} An instance refers to a particular instantiation of a FIRRTL module. An instance is constructed with a given name and a given module name. |
