-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add VPU to NaxRiscv? #10
Comments
Hi ^^ I guess the main chalange will be how the memory load / store would be made and keept coherent with the l1 cache. One thing which may interrest you is the way in which the FPU support was added. Do you have some design idea ? |
For VPU as ARA did,(https://github.com/pulp-platform/ara), it access the memory independantly.The RV is a "feeder", fetch,decode,commit(and feed data to VPU if neede ),wait respose, retire(and get data if needed).In most case, VPU just get instruction and give "retire" response immediately. |
It is interesting. |
Hi ^^ Sorry for the delay.
For the FPU i think the complexity for the NaxRiscv one come from the fact that it handle the out of hander execution. So if i understand well you aren't realy looking at handeling out of order execution for the VPU execution / VPU load&store ? Also what's about register renaming and depedencies tracking ? |
Hi |
Hmm, and sometime i guess you have some integer values from/to the int regfile right ? |
OK,I'll try it .Thanks. |
The main tricky things will be interraction between the VPU and the integer register file. Do you know the kind of interractions it does ? For instance, in the FPU we have load/store addresses, float <> int convertion and cast. |
VPU read/write memory independantly and has its own register file (for example 32 lines X 1024 bits).It share FP opode for load/store and need integer register as base address. And there are also four instructions to move interger/float register to/from vector register. |
What the interface needed is {instruction , rs1,rs2} and VPU will return rd if needed. case class VpuRsp() extends Bundle{ case class VpuBus() extends Bundle with IMasterSlave { override def asMaster() = { |
But , when I build it ,Get elaborate erroor: [info] ********************************************************************************************** |
Is there any way to get the instruction simply? |
So, one place where you could easily get instruction stream in order would be in the FrontendPlugin dispatch stage. That's just before things are pushed in the issue queue for out of order execution. But this will be problematic for VPU instruction which interract with the integer/float register files. Could you show the code of your Plugin ? |
package naxriscv.execute //This plugin example will add a new instruction named SIMD_ADD which do the following : case class VpuCmd() extends Bundle{ case class VpuRsp() extends Bundle{ case class VpuBus() extends Bundle with IMasterSlave { override def asMaster() = { object SimdAddPlugin{ //ExecutionUnitElementSimple Is a base class which will be coupled to the pipeline provided by a ExecutionUnitBase with //The setup code is by plugins to specify things to each others before it is too late
// add(SimdAddPlugin.ADD4) // add(SimdAddPlugin.VADD4) override val logic = create late new Logic{
// rd( 7 downto 0) := rs1( 7 downto 0) + rs2( 7 downto 0)
// val instruction = Frontend.MICRO_OP().asUInt object SimdAddNaxGen extends App{ def plugins = { val spinalConfig = SpinalConfig(inlineRom = true) val report = spinalConfig.generateVerilog(new NaxRiscv(plugins)) |
I just modified SimdAddPlugin.scala and added one RVV instrution. |
And , define RVV instruction as : |
object VecRegFile extends RegfileSpec with AreaObject { [Pls dont mind the define of TypeV, just try to add some reg dependency.] |
I write a simpled test program using SimdAdd test program, it can run correctly and the waveform shows corrrectly. The elaborate error appears. |
It just a simple experimental. What I want is to get RVV instruction and send it with a "external" module with resolved register value. |
Can I use ExecuteInitDemo.scala as template? |
Ahhh what is ExecuteInitDemo ? produce an error is because Frontend.MICRO_OP() create a new instance of the data type, it doesn't access it in the pipeline. Does Frontend.MICRO_OP.asUInt works ? else stage(Frontend.MICRO_OP).asUInt should be good. Also, be aware that ExecutionUnitElementSimple is kind of only for integer registerfile instruction : For a raw execution unit element plugin, you can see : |
Oh, what I mean is "ExecuteUnitDemo.scala". |
Hmm, not realy, i mean, it is kind of a outdated example to create a full execution unit. Is it what you want ? |
Just to be sure, you didn't added a RegFilePlugin with VecRegFile right ? (should not be added) |
Ok,Thanks.I didn'nt added a RegFilePlugin with VecRegFile. The VecRegFile defined in RegFile.scala is just used to resolve the Integer Or Float Register dependencies . |
Ok ^^ Also, in which context are you doing this project ?
|
For Study now .Thanks. I tried ARA ,which is a VPU for Ariane . But Ariane/CVA6 is an in-order Open source Core . The performance is low. |
By curiosity, can you define "performance is low" ?
Also, i have to say, adding the VPU is realy not a simple thing ^^ There is a lot of part in naxriscv working together to get OoO up and running, and is currently put in place to have instructions waking each others through their depedencies / ROB id
What are your targeting / hopping as performance ? |
I am trying to ADD VPU to NaxRiscv.
The text was updated successfully, but these errors were encountered: