Fix misinterpretation of swacc behavior. Is asserted on both sw read and write. #21

This commit is contained in:
Alex Mykyta
2022-11-07 22:45:51 -08:00
parent 0edb36f07e
commit 32f102263b
3 changed files with 19 additions and 9 deletions

View File

@@ -42,9 +42,9 @@ swacc
^^^^^
|OK|
If true, infers an output signal ``hwif_out..swacc`` that is asserted on the
same clock cycle that the field is being sampled during a software read
operation.
If true, infers an output signal ``hwif_out..swacc`` that is asserted when
accessed by software. Specifically, on the same clock cycle that the field is
being sampled during a software read operation, or as it is being written.
.. wavedrom::

View File

@@ -22,8 +22,8 @@ field -> swacc
^^^^^^^^^^^^^^
|EX|
Single-cycle strobe that indicates the field is being sampled during a software
read operation.
Single-cycle strobe that indicates the field is being accessed by software
(read or write).
field -> swmod

View File

@@ -173,15 +173,25 @@ class FieldLogic:
def get_swacc_identifier(self, field: 'FieldNode') -> str:
"""
Asserted when field is software accessed (read)
Asserted when field is software accessed (read or write)
"""
buffer_reads = field.parent.get_property('buffer_reads')
if buffer_reads:
buffer_writes = field.parent.get_property('buffer_writes')
if buffer_reads and buffer_writes:
rstrb = self.exp.read_buffering.get_trigger(field.parent)
return rstrb
wstrb = self.exp.write_buffering.get_write_strobe(field)
return f"{rstrb} || {wstrb}"
elif buffer_reads and not buffer_writes:
strb = self.exp.dereferencer.get_access_strobe(field)
rstrb = self.exp.read_buffering.get_trigger(field.parent)
return f"{rstrb} || ({strb} && decoded_req_is_wr)"
elif not buffer_reads and buffer_writes:
strb = self.exp.dereferencer.get_access_strobe(field)
wstrb = self.exp.write_buffering.get_write_strobe(field)
return f"{wstrb} || ({strb} && !decoded_req_is_wr)"
else:
strb = self.exp.dereferencer.get_access_strobe(field)
return f"{strb} && !decoded_req_is_wr"
return strb
def get_swmod_identifier(self, field: 'FieldNode') -> str:
"""