File tree Expand file tree Collapse file tree
src/peakrdl_python/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,11 +130,14 @@ class {{fq_block_name}}_single_access({{top_node.inst_name}}_SimTestCase): # typ
130130 self.assertIsInstance(sim_register, (Register,MemoryRegister))
131131 sim_field = self.sim.field_by_full_name('{{'.'.join(node.get_path_segments())}}')
132132 {% if node .is_sw_readable and node .is_sw_writable -%}
133- self.assertIsInstance(sim_field, ReadWriteField)
133+ if not isinstance(sim_field, ReadWriteField):
134+ raise TypeError(f'should be a simulated read/write field got {type(sim_field)}')
134135 {% elif node .is_sw_readable and not node .is_sw_writable -%}
135- self.assertIsInstance(sim_field, ReadOnlyField)
136+ if not isinstance(sim_field, ReadOnlyField):
137+ raise TypeError(f'should be a simulated read/write field got {type(sim_field)}')
136138 {% elif not node .is_sw_readable and node .is_sw_writable -%}
137- self.assertIsInstance(sim_field, WriteOnlyField)
139+ if not isinstance(sim_field, WriteOnlyField):
140+ raise TypeError(f'should be a simulated read/write field got {type(sim_field)}')
138141 {% endif %}
139142 register_read_callback = Mock()
140143 register_write_callback = Mock()
You can’t perform that action at this time.
0 commit comments