-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Export file structure of to_python method #58
Comments
Do we have an example IP-XACT we can refer to? |
|
I was thinking of a more elaborate/real life example, but basically a component in IP-XACT is an Origen block. |
So it would be |
@ginty Also, do we need to have a sub-dir specifying |
@ginty Also, what will the API to connect sub-blocks to memory maps and address blocks look like? I believe we don't currently have a way to create a memory map and address block within a sub-block. |
Yeah, pretty much. I think we might also add special handling for blocks which are DUTs (top-levels) vs. those which can be instantiated within a DUT, maybe the user will need to supply I think the Rust would go in the same dir, just with a different extension, |
This is creating memory maps and address blocks within a sub-block.
Each containing their respective memory map and address blocks. If there was a hierarchical relationship between them (and I'm kind of assuming IP-XACT can express such things which is why I was interested in a more complex example), say SubBlock("blk2_instance_name", block_path="blk2") |
Thx @ginty for the explanations. Are the derivatives essentially a 1:1 map to an eventual target? Should the export also create target files? |
Yes, and yes you could also create a corresponding target file. |
So I could choose not to make objects in memory and write directly to file and then load the files to make the objects in memory |
Sure, and that's how I envisaged this would go originally. |
Ok so to make everything modeled in memory first, don't we have to enhance the API to allow memory maps to connected to sub blocks or visa versa? |
I think you might be right, I was thinking that #52 would give you the way to programmatically join blocks together, however I see now that this only provides a way to link up an existing blocks (i.e. those that already exist in the file system). |
Another thought I've been having on this is that maybe we should have a I did some quick bench-marking the other day of how instantiating 20,000 registers compared in O2 vs O1 and O2 actually came out a bit slower (~3.5s vs. ~1.5s). So I'm wondering if we would be better off ditching Python for imported regs and use TOML instead. This is a format that ticks the box of being readable and easily editable by humans, but which is also well supported by Rust. |
@ginty I think I will complete all 3 formats so we can have proper benchmarking and be fully informed when we choose a direction. |
Yeah the API does need some work IF one wants to use nested code blocks to add everything (which is the best way in the long haul IMO). However I think I could use this pattern for now. owner = SubBlock("core0", block_path="core")
owner.with MemoryMap("test"):
with AddressBlock("bank0"):
SimpleReg("reg1", 0)
with Reg("reg2", 0x0024, size=16) as reg:
reg.bit([4,0], "adch", reset=0x1F) |
@ginty Not to throw a spanner in here (think that is correct usage) but could this make us reassess a Python only solution? Not trying to ditch Rust but would like to hear your thoughts on why Rust makes the most sense in the long haul. This is a question more for my edification rather than a serious proposal on my part. |
I don't think the fact that register definition/instantiation is currently slower is a reflection on the overall performance we should expect. Also note that O1 was seriously optimized in this area, while O2 is barely a couple of months old, though it does already have lazy-loading of sub-blocks and register files which make this benchmark case of importing 20K regs at once not really realistic. However, even if we ended up with O2 performance the same or a bit worse than O1 I would still support the current direction for the following non-performance-related reasons:
Both of these are key reasons why I want to keep O2's Python footprint to a minimum. |
Just to update this thread - I realised that I should probably try O2 compiled with Rust's |
Hi,
Can we clearly define the file structure created for a future
to_python
method? This info will also be helpful when also making the associatedto_rust
method. In O1 we only output pins, packages, sub_blocks, and registers. We had no concept of memory maps or address blocks IIRC.Also, is there consensus on whether the export should be specific to the target or the application?
vendor/falcon
orvendor/example
.thx
The text was updated successfully, but these errors were encountered: