3 ms·
Easier than VHDL, harder than C. Chisel's "adder" example on the wikipedia page is: class Add extends Module { val io = IO(new Bundle { val a = Inp
by aappleby 5y ago
Easier than VHDL, harder than C. Chisel's "adder" example on the wikipedia page is:
class Add extends Module {
val io = IO(new Bundle {
val a = Input(UInt(8.W))
val b = Input(UInt(8.W))
val y = Output(UInt(8.W))
})
io.y := io.a + io.b
}
whereas the same in C would be
uint8_t Add(uint8_t a, uint8_t b) {
return a + b;
}
and while that is not directly usable in SystemVerilog, it can be mechanically translated to
function byte add(byte a, byte b)
return a + b;
endfunction
There's way more to it than that, but I strongly believe there are better ways of writing hardware than the existing HDLs.
- flatiron 5y agoHonestly from the chisel and C example I can’t really see much a difference. Not sure why corporate it making me choose. That io bundle in your first example is defined in place and then used. If that was previously defined (which would be a shitty Wikipedia example) it would look a lot like your C example.
- artemonster 5y agoImho, you‘re barking at the wrong tree. Design with existing HDLs is a solved problem. Verification is not :)