Comments (12)
@KireinaHoro Pused to SpinalHDL dev branch :)
from spinalhdl.
Hi,
i kinda recentrly implemented a feature a bit like it. But instead of using a DataType parameter, i used something a bit more "dynamic"
it is named HardMap :
https://github.com/SpinalHDL/VexiiRiscv/blob/39ec45a01d0cf9e1701823f64f1897337fdc34f1/src/main/scala/spinal/core/HardMap.scala#L8
Idea is that you can create it and fill it with NamedType a bit like a hash map.
from spinalhdl.
This looks interesting. So I imagine one would put this into the data
element of the Axi4Stream bundle? How would this look like if used in IO?
from spinalhdl.
Something around that :
case class MyBus(things : Seq[NamedType[_ <: Data]]) extends Bundle{
val hm = new HardMap()
things.foreach(e => hm.add(e))
}
val CTX_A = NamedType(Bool())
val CTX_B = NamedType(Bool())
val bus = MyBus(Seq(CTX_A, CTX_B))
from spinalhdl.
Since Axi4Stream
is very much an analog of Stream
would it not make sense to make it generic over the type?
from spinalhdl.
would it not make sense to make it generic over the type?
How do you mean it ? (for me to understand)
from spinalhdl.
https://fars.ee/Co-Z/scala @Dolu1990 I have something like this that works quite well for my use case. But this is not the same thing as the HardMap solution you proposed since I pass in a payloadType: Bundle
to the config.
from spinalhdl.
How do you mean it ? (for me to understand)
To have the payload as a generic type, just like the Stream has it, i.e.
Axi4Stream(MyBundle(), ...)
and maybe a conversion function to Axi4Stream(Bits(), ...)
for the edges.
Do we have to stick to the "type" in the spec here?
from spinalhdl.
since I pass in a payloadType: Bundle to the config.
Yes it is also a good solution, [T <: Data] ... payloadType[HardType[T]]
I'm not sure what is the best between having a ArrayBuffer[NamedType] vs payloadType[HardType[T]]
Maybe i'm bing too much into the HardMap thing because of composability in CPU design, which isn't the rule in general design
Axi4Stream(MyBundle(), ...) and maybe a conversion function to Axi4Stream(Bits(), ...) for the edge
Ahhh i would say it would be kinda too much away from the the Axi4stream spec usage.
Axi4stream is realy a byte oriented stream, with some eventual "compagnions", so more Axi4StreamConfig(dataWidth, ... , optionalHardType)
from spinalhdl.
@Dolu1990 I'm trying to build something else with the HardMap as the USER field; would you mind upstreaming it into SpinalHDL (from VexiiRiscv)? Thanks :)
from spinalhdl.
Keep in mind, not sure what is the best overall :
- Bits with parametrable bit count
- Parametrable Data type
- HardMap with elements in parameter
I'm thinking that maybe the best is just Bits, as when you have a Axi4Stream interconnect, you realy don't care about the meaning of the data.
from spinalhdl.
I agree about the Bits option; we can probably use HardMap to wrap another layer for such a use-case. However, the current implementation enforces a Byte interface as required by the standard; allowing Bits means deviation.
from spinalhdl.
Related Issues (20)
- Nesting SlowAreas produces unexpected results HOT 1
- Formal: support for temporal sequences HOT 17
- Formal proofs started to fail with newer versions of sby HOT 11
- Could you please advise if there is any method to generate a port in the format of [lsb:msb]? HOT 6
- Porting to spinalHDL HOT 4
- Rethink on pastValid function.
- trait use help HOT 3
- Porting SpinalHDL to CIRCT? HOT 5
- PackedBundle EndiannessSwap HOT 2
- Support for AMBA ACE4 HOT 9
- About convenient anonymous bundle. HOT 6
- AhbLite3OnChipRam (and Rom) do not support aligned access less than word size
- switch generate redundant verilog code HOT 3
- How to implement multiple stages in one Node by using the misc.pipeline utility. HOT 4
- Payloads cross StageLink would be elborated into combinational logic. HOT 1
- Issues with newer Verilator Versions HOT 1
- Attributes on IO result in invalid syntax in VHDL HOT 3
- formal: GlobalClock() produces invalid VHDL HOT 3
- How about ignore the clone error while using generate in insert of Node. HOT 1
- `:=` behaves unexpectedly on `Fragment[BaseType]`
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 spinalhdl.