More testcases & documentation
This commit is contained in:
@@ -1 +1 @@
|
||||
__version__ = "0.1.0"
|
||||
__version__ = "0.1.0-a1"
|
||||
|
||||
@@ -81,12 +81,14 @@ class Dereferencer:
|
||||
def get_field_propref_value(self, field: FieldNode, prop_name: str) -> str:
|
||||
# Value reduction properties.
|
||||
# Wrap with the appropriate Verilog reduction operator
|
||||
val = self.get_value(field)
|
||||
if prop_name == "anded":
|
||||
val = self.get_value(field)
|
||||
return f"&({val})"
|
||||
elif prop_name == "ored":
|
||||
val = self.get_value(field)
|
||||
return f"|({val})"
|
||||
elif prop_name == "xored":
|
||||
val = self.get_value(field)
|
||||
return f"^({val})"
|
||||
|
||||
# references that directly access a property value
|
||||
@@ -159,7 +161,7 @@ class Dereferencer:
|
||||
prop_value = field.get_property(complementary_pairs[prop_name])
|
||||
if prop_value is True:
|
||||
# Points to inferred hwif input
|
||||
return f"!({self.hwif.get_implied_prop_input_identifier(field, prop_name)})"
|
||||
return f"!({self.hwif.get_implied_prop_input_identifier(field, complementary_pairs[prop_name])})"
|
||||
elif prop_value is False:
|
||||
# This should never happen, as this is checked by the compiler's validator
|
||||
raise RuntimeError
|
||||
|
||||
@@ -8,7 +8,6 @@ if TYPE_CHECKING:
|
||||
from systemrdl.node import FieldNode
|
||||
|
||||
# TODO: implement sw=w1 "write once" fields
|
||||
# TODO: Implement swwe/swwel masking properties
|
||||
|
||||
class _OnWrite(NextStateConditional):
|
||||
onwritetype = None
|
||||
@@ -17,8 +16,15 @@ class _OnWrite(NextStateConditional):
|
||||
|
||||
def get_predicate(self, field: 'FieldNode') -> str:
|
||||
strb = self.exp.dereferencer.get_access_strobe(field)
|
||||
|
||||
if field.get_property('swwe') or field.get_property('swwel'):
|
||||
# dereferencer will wrap swwel complement if necessary
|
||||
qualifier = self.exp.dereferencer.get_field_propref_value(field, 'swwe')
|
||||
return f"{strb} && decoded_req_is_wr && {qualifier}"
|
||||
|
||||
return f"{strb} && decoded_req_is_wr"
|
||||
|
||||
|
||||
def _wr_data(self, field: 'FieldNode') -> str:
|
||||
if field.msb < field.lsb:
|
||||
# Field gets bitswapped since it is in [low:high] orientation
|
||||
@@ -34,7 +40,7 @@ class WriteOneSet(_OnWrite):
|
||||
def get_assignments(self, field: 'FieldNode') -> List[str]:
|
||||
field_path = self.get_field_path(field)
|
||||
return [
|
||||
f"field_combo.{field_path}.next = field_storage.{field_path} | {self._wr_data(field)}];",
|
||||
f"field_combo.{field_path}.next = field_storage.{field_path} | {self._wr_data(field)};",
|
||||
f"field_combo.{field_path}.load_next = '1;",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user