Comments (7)
Thanks. Yeah, I'd missed registering my new classes so I wasn't calling what I thought I was.
So I now have things sort of working. The correct default_map gets called and I'm entering my custom do_bus_write() method. However, the logic there seems a bit broken. I'm performing a REG write and the rw_access.n_bits and rw_access.byte_en fields are 0 and -1 respectively. They don't seem to be setup correctly for the datawidth.
Is this functionality just missing here and is a TODO item? They only seem to be updated for UVM_FIELD.
Edit: found and fixed the issues here. See #32
from uvm-python.
from uvm-python.
Thanks, I'll give it another go.
One of my concerns with using this library for the register model was how much of it depends on all your UVM backend classes. We're using standard Cocotb with cocotb-coverage for our project and I was trying to find a UVM like register model to use - we're using the OpenTitan regtool.py to generate our registers and they use SV UVM - so using this library made sense but the more I look at it, the more it seems to not make sense for us.
For example, the UVMRegBlock class expects to be hooked up to a sequencer and adapter for the read/write functionality whereas for our use case we probably just want to hook it directly to our bus driver. Is this doable and how might we do this? Create a wrapper class that translates between the UVM sequencer to provide pure write/read methods to our side? Just thinking out loud really while I try to get my head round all the UVM methodology which I've not used before.
from uvm-python.
from uvm-python.
Thanks, I've had a closer look at the classes today. In uvm_reg::do_write, the only instance of anything sequency is if a user defined frontdoor has been defined I think. In that case, the sequence start() method is called, otherwise the uvm_reg_map::do_write() method is called. If we're just using a standard uvm_reg_block with a uvm_reg_map, we wouldn't be using a user defined frontdoor would we? Just thinking if there's actually anything in uvm_reg::do_{read,write} that I actually need to override.
from uvm-python.
Edit: a missing uvm_object_utils
was the cause of my confusion. I'll update later with more progress...
So I've got a bit further and have my customised classes now. I didn't implement one for UVMReg as it looked like I didn't need it and it looks like the flow skips the sequence.start() method in do_write(). However, when it gets to calling rw.local_map.do_write(rw), it seems to be calling UVMRegMap and not my customised class, DVRegMap.
I can't see where this local_map is defined. In UVMReg::write() a new UVMRegItem is created but _map is None and rw.local_map is not written.
I'm calling the write function from my custom DVReg class:
class reg_udma_CONTROL(DVReg):
def __init__(self, name="udma_CONTROL"):
super().__init__(name, 32)
self.ENABLE = None
def build(self):
self.ENABLE = DVRegField.type_id.create("ENABLE")
self.ENABLE.configure(
self,
32,
0,
"RW",
False,
0,
True,
False,
False
)
uvm_object_utils(reg_udma_CONTROL)
class regblock_udma(DVRegBlock):
def __init__(self, name="u_udma_regfile"):
super().__init__(name)
self.CONTROL = None
def build(self):
self.CONTROL = reg_udma_CONTROL.type_id.create("CONTROL")
self.CONTROL.configure(self, None, "u_dma_control.q")
self.default_map = self.create_map("default_map", 0x0, 4, UVM_LITTLE_ENDIAN)
self.default_map.add_reg(self.CONTROL, 0x0, "RW")
uvm_object_utils(regblock_udma)
@cocotb.test(timeout_time = 1000, timeout_unit='ns')
async def test_block(dut):
# snip
status = []
await tb.regmodel.CONTROL.write(status, 0xdeadbeef)
from uvm-python.
from uvm-python.
Related Issues (20)
- uvm_info HOT 6
- UVM Python minimal test HOT 6
- registers/vertical_reuse blk-level simulation fails with ghdl/VHDL DUT HOT 11
- Documentation rendering issue HOT 7
- Bug in uvm_reg_map.py HOT 3
- Typo in uvm_reg_field.py HOT 2
- Correct way to clean up UVM objects HOT 2
- Latest version of cocotb Verilator will always issue error %Error-TIMESCALEMOD. HOT 4
- test uvm-python/test/examples/integrated/ubus/examples for "read modify write" can not be randomized with the uvm_do_with HOT 3
- Cross TLM communication HOT 2
- uvm hw reset sequence bug HOT 2
- Test failing HOT 1
- uvm_do doesn't work HOT 2
- Using uvm-python for with custom build infrastructure HOT 4
- Is there a way to mix SystemVerilog UVM and UVM-Python environments? HOT 2
- Should we use PyVSC with UVM-Python to get constrained random and coverage working? Or, is there something similar already in the library? HOT 1
- Any example that shows integrating C++/SystemC predictor? HOT 1
- examples/sv is failing ... any ideas? HOT 1
- Do you support uvm_component_param_utils? Any alternative approach? Any example? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uvm-python.