-
Notifications
You must be signed in to change notification settings - Fork 40
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
about litex and dhrystone #96
Comments
Hi, Which dhrystone software are you using, i don't remember providing any dhrystone for litex. |
No,No,No,It's not about the dhrystone program for litex, but the dhrystone program and makefile in the ext/Maxsofware directory of your Naxriscv directory,
发自我的iPhone
…------------------ Original ------------------
From: Dolu1990 ***@***.***>
Date: Tue,Apr 30,2024 6:22 PM
To: SpinalHDL/NaxRiscv ***@***.***>
Cc: duanjiulon ***@***.***>, Author ***@***.***>
Subject: Re: [SpinalHDL/NaxRiscv] about litex and dhrystone (Issue #96)
|
No software from ext/NaxSoftware is designed to run on litex (excepted the instruction for debian) |
OK,fine,dear dolu,I have done this by litex intergration,
I want to know about how to confige with the litex, agrument, thanks. |
Hi, On litex, i generaly use : to get a debian ready core, so you can change it with --xlen=32 and rvc=false,rvf=false,rvd=false Then about coremark, it realy depend how you compiled it. Also, with binary in the main memory, not in io mapped one. I didn't tested on litex specificaly, that coremark was for simulation only. |
Hi,dear Dolu,
class FetchAxi4(ramDataWidth : Int,
ioDataWidth : Int,
toPeripheral : FetchL1Cmd => Bool
) extends Plugin{
val logic = create late new Area{
val cache = getService[FetchCachePlugin]
val native = cache.mem.setAsDirectionLess
val (ram, peripheral) = native.split(toPeripheral)
val axiRam = master(ram.resizer(ramDataWidth).toAxi4())
val axiPeripheral = master(peripheral.resizer(ioDataWidth).toAxiLite4())
Axi4SpecRenamer(axiRam)
AxiLite4SpecRenamer(axiPeripheral)
}
} 2.There is a setting in Briey.scala regarding ibus and dbus: Val core=new Area{
Val config=VexRiscvConfig(
Plugins=cpuPlugins+=new DebugPlugin (debugClockDomain)
)
Val CPU=new VexRiscv (config)
Var iBus: Axi4ReadOnly=null
Var dBus: Axi4Shared=null
For (plugin<- config. plugins) plugin match{
Case plugin: IBusSimplePlugin=>iBus=plugin. iBus. toAxi4ReadOnly()
Case plugin: IBusCachedPlugin=>iBus=plugin. iBus. toAxi4ReadOnly()
Case plugin: DBusSimplePlugin=>dBus=plugin. dBus. toAxi4Shared()
Case plugin: DBusCachedPlugin=>dBus=plugin. dBus. toAxi4Shared (true)
Case plugin: CsrPlugin=>{
Plugin. externalInterrupt:=BufferCC (io. coreInterrupt)
Plugin. timerInterrupt:=timerCtrl. io. interrupt
}
Case plugin: DebugPlugin=>debugClockDomain{
ResetCtrl. axiReset setWhen (RegNext (plugin. io. resetOut))
Io. jtag<>plugin. io. bus. frmJtag()
}
Case_=>
}
}
```
What are the differences between the settings of ibus and dbus in the two types of cores
in the scala file:
````scala
val core = new NaxRiscv(l)
core.plugins.foreach{
case p : FetchCachePlugin => iBus.bus << p.mem.toTilelink()
case p : DataCachePlugin => dBus.bus << p.mem.toTilelink()
case p : Lsu2Plugin => pBus.bus << p.peripheralBus.toTilelink()
case p : PrivilegedPlugin => {
p.io.int.machine.timer := mti.flag
p.io.int.machine.software := msi.flag
p.io.int.machine.external := mei.node.flag
if(p.p.withSupervisor) p.io.int.supervisor.external := sei.node.flag
if(p.p.withRdTime) p.io.rdtime := clint.thread.core.io.time
}
case _ =>
}
}
```
finally,I want to develop an Ibus and dbus interface similar to vex_core, but I don't know how to handle pbus |
Hi,
I think the reason was to be compatible with litex, but overall, a single bus is fine.
I'm not sure to understand, one is AXI one is tilelink, but fondamentaly the kind of access going through is the same, just that nax is writeback => less write trafic
Would need a bridge. But overall why not using the FetchAxi4 in the
I'm confused by the code above |
There is currently no lib library available for converting pbus to AXI, and as far as I know, the LSUPlgins. scala file only has the axilite conversion interface.
What I mean is the difference in functionality between FetchPlgins with AXI4 interface and ibus-axi4readonly in vex, and datacache-axi4 interface and vex-axi4dbus in vex
what you say is:
this one? |
dear dulo, in the gen.scala, I add the code: plugins += new DataCacheAxi4(
dataWidth = 32
)
plugins += new FetchAxi4(
dataWidth = 32
)
////
plugins += new LsuPeripheralAxiLite4(
ioDataWidth = 32
)
////
I have modified fetchaxi4. scala to single port readonly axi4 and obtained the result. Can the three interfaces here be considered as ibus, dbus, and pbus。And I want to know the addressing range of the three buses in the core output wire FetchAxi4_logic_axi_arvalid,
input wire FetchAxi4_logic_axi_arready,
output wire [31:0] FetchAxi4_logic_axi_araddr,
output wire [7:0] FetchAxi4_logic_axi_arlen,
output wire [2:0] FetchAxi4_logic_axi_arsize,
output wire [1:0] FetchAxi4_logic_axi_arburst,
output wire [2:0] FetchAxi4_logic_axi_arprot,
input wire FetchAxi4_logic_axi_rvalid,
output wire FetchAxi4_logic_axi_rready,
input wire [31:0] FetchAxi4_logic_axi_rdata,
input wire [1:0] FetchAxi4_logic_axi_rresp,
input wire FetchAxi4_logic_axi_rlast,
output wire DataCacheAxi4_logic_axi_awvalid,
input wire DataCacheAxi4_logic_axi_awready,
output wire [31:0] DataCacheAxi4_logic_axi_awaddr,
output wire [0:0] DataCacheAxi4_logic_axi_awid,
output wire [7:0] DataCacheAxi4_logic_axi_awlen,
output wire [2:0] DataCacheAxi4_logic_axi_awsize,
output wire [1:0] DataCacheAxi4_logic_axi_awburst,
output wire [2:0] DataCacheAxi4_logic_axi_awprot,
output wire DataCacheAxi4_logic_axi_wvalid,
input wire DataCacheAxi4_logic_axi_wready,
output wire [31:0] DataCacheAxi4_logic_axi_wdata,
output wire [3:0] DataCacheAxi4_logic_axi_wstrb,
output wire DataCacheAxi4_logic_axi_wlast,
input wire DataCacheAxi4_logic_axi_bvalid,
output wire DataCacheAxi4_logic_axi_bready,
input wire [0:0] DataCacheAxi4_logic_axi_bid,
input wire [1:0] DataCacheAxi4_logic_axi_bresp,
output wire DataCacheAxi4_logic_axi_arvalid,
input wire DataCacheAxi4_logic_axi_arready,
output wire [31:0] DataCacheAxi4_logic_axi_araddr,
output wire [0:0] DataCacheAxi4_logic_axi_arid,
output wire [7:0] DataCacheAxi4_logic_axi_arlen,
output wire [2:0] DataCacheAxi4_logic_axi_arsize,
output wire [1:0] DataCacheAxi4_logic_axi_arburst,
output wire [2:0] DataCacheAxi4_logic_axi_arprot,
input wire DataCacheAxi4_logic_axi_rvalid,
output wire DataCacheAxi4_logic_axi_rready,
input wire [31:0] DataCacheAxi4_logic_axi_rdata,
input wire [0:0] DataCacheAxi4_logic_axi_rid,
input wire [1:0] DataCacheAxi4_logic_axi_rresp,
input wire DataCacheAxi4_logic_axi_rlast,
input wire reset,
output wire LsuPeripheralAxiLite4_logic_axi_awvalid,
input wire LsuPeripheralAxiLite4_logic_axi_awready,
output wire [31:0] LsuPeripheralAxiLite4_logic_axi_awaddr,
output wire [2:0] LsuPeripheralAxiLite4_logic_axi_awprot,
output wire LsuPeripheralAxiLite4_logic_axi_wvalid,
input wire LsuPeripheralAxiLite4_logic_axi_wready,
output wire [31:0] LsuPeripheralAxiLite4_logic_axi_wdata,
output wire [3:0] LsuPeripheralAxiLite4_logic_axi_wstrb,
input wire LsuPeripheralAxiLite4_logic_axi_bvalid,
output wire LsuPeripheralAxiLite4_logic_axi_bready,
input wire [1:0] LsuPeripheralAxiLite4_logic_axi_bresp,
output wire LsuPeripheralAxiLite4_logic_axi_arvalid,
input wire LsuPeripheralAxiLite4_logic_axi_arready,
output wire [31:0] LsuPeripheralAxiLite4_logic_axi_araddr,
output wire [2:0] LsuPeripheralAxiLite4_logic_axi_arprot,
input wire LsuPeripheralAxiLite4_logic_axi_rvalid,
output wire LsuPeripheralAxiLite4_logic_axi_rready,
input wire [31:0] LsuPeripheralAxiLite4_logic_axi_rdata,
input wire [1:0] LsuPeripheralAxiLite4_logic_axi_rresp,
dear dulo,in the code,Can I directly understand it as a functional file for converting the original LsuPlugin_peripheralBus to a bridge of axi4lite? class LsuPeripheralAxiLite4(ioDataWidth : Int,
reg_stage_cmd : Boolean = false,
reg_stage_ret: Boolean = true) extends Plugin{
val logic = create late new Area{
val peripheralBus = getServiceOption[LsuPlugin].map(_.peripheralBus).getOrElse(getServiceOption[Lsu2Plugin].map(_.peripheralBus).get)
val native = peripheralBus.setAsDirectionLess
val resized = native.resize(ioDataWidth)
val axiRaw = resized.toAxiLite4()
val axi = master(cloneOf(axiRaw))
if (reg_stage_cmd) {
axi.aw << axiRaw.aw.halfPipe()
axi.w << axiRaw.w.halfPipe()
axi.ar << axiRaw.ar.halfPipe()
} else {
axi.aw << axiRaw.aw
axi.w << axiRaw.w
axi.ar << axiRaw.ar
}
if (reg_stage_ret) {
axi.b.halfPipe() >> axiRaw.b
axi.r.halfPipe() >> axiRaw.r
} else {
axi.b >> axiRaw.b
axi.r >> axiRaw.r
}
AxiLite4SpecRenamer(axi)
}
}
|
Hello, dear dulo,recently I tested multiple core configurations of naxriscv in your recommended emulation method (on git) emulation and litex separately, and found that for the first way: loading the elf file into a specific sim_mem for testing will have better results, 2-alu, 2-decode will have a dhrystone score of 2.93, but under the same configuration, I use litex_ SoC loading ROM for simulation or board testing, the result is only about 1 drystone score,please help me why is this,thanks |
Hi, |
Hi,dear Dolu,Considering that I often use the suffix vcd file to analyze waveforms, and the fst wave file cannot be opened correctly on my computer, I have sent you the. vcd file and fst file together. The program flow of dhrystone is as follows: 1. Print version information to the serial port, you can check reslutREADME.txt, then read the start time, start running dhrystone, read the end time, and print the result to the serial port after running. The compressed file size may be around 2GB, please be patient and download it. Thank you for your suppor!
https://mail.qq.com/cgi-bin/ftnExs_download?k=25343463c6aaba420053485e1264061c1c400007515505554902015b064902515c0719525601511e01510400575705020151555634683455174014145512511d1e5d446309&t=exs_ftn_download&code=d44c4d43
段玖龙
***@***.***
…------------------ 原始邮件 ------------------
发件人: "SpinalHDL/NaxRiscv" ***@***.***>;
发送时间: 2024年6月5日(星期三) 晚上10:11
***@***.***>;
***@***.******@***.***>;
主题: Re: [SpinalHDL/NaxRiscv] about litex and dhrystone (Issue #96)
Hi,
Could you send me the fst wave of the litex simulation ?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
从QQ邮箱发来的超大附件
fst wave.zip (2.23G, 2024年07月06日 11:08 到期)进入下载页面:https://mail.qq.com/cgi-bin/ftnExs_download?k=25343463c6aaba420053485e1264061c1c400007515505554902015b064902515c0719525601511e01510400575705020151555634683455174014145512511d1e5d446309&t=exs_ftn_download&code=d44c4d43
|
dear dulo,I'm sorry to ask you another question. If I still want to get a lightweight core, which plugins do I need to close while ensuring that the core can run? For example, can branch prediction be closed? Can many random launches be achieved by turning off certain piungis and turning them into sequential launches, resulting in a core that occupies less LUT resources (similar to vex_core),thank you so much! |
Hi, I checked the simulation wave, and i can see the the integer divider is never used, did you compiled with -march=rv32im ? |
You may remove the PerformanceCounterPlugin, reduce the LQ SQ size and swap the MMU for the StaticAddressTranslationPlugin, ensure the core if configure with single decoder, 1 alu, no RVC Also, you may be interrested by VexiiRiscv is you look for small 64 bits support, but in order. |
Besides that, I changed arch to im and my score increased to 1.09,Could you please take a look at the waveform again? Do you have any other questions |
In the wave form you sent me, divider was never used => that wave form has no use anymore. Can you send me your complied dhrystone ? |
elf file |
ok,fine |
I only modified the print function and time access function in the code, and did not modify anything else
You can run it by loading it through jtag |
The btb has only 32 entries ? BtbPlugin_logic_mem. If yes, that is way to few |
Should be (* ram_style = "block" *) reg [49:0] BtbPlugin_logic_mem [0:511]; |
I have not made any changes to the plugins related to BTB, and the entire SOC is generated through commands.
发自我的iPhone
…------------------ Original ------------------
From: Dolu1990 ***@***.***>
Date: Fri,Jun 7,2024 6:47 PM
To: SpinalHDL/NaxRiscv ***@***.***>
Cc: duanjiulon ***@***.***>, Author ***@***.***>
Subject: Re: [SpinalHDL/NaxRiscv] about litex and dhrystone (Issue #96)
The btb has only 32 entries ? BtbPlugin_logic_mem. If yes, that is way to few
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Can you send pythondata-cpu-naxriscv/pythondata_cpu_naxriscv/verilog/NaxRiscvLitex*.v ? |
dear dolu, You can generate the v file using the command I just sent you about litex_sim.py
发自我的iPhone
…------------------ Original ------------------
From: Dolu1990 ***@***.***>
Date: Fri,Jun 7,2024 6:55 PM
To: SpinalHDL/NaxRiscv ***@***.***>
Cc: duanjiulon ***@***.***>, Author ***@***.***>
Subject: Re: [SpinalHDL/NaxRiscv] about litex and dhrystone (Issue #96)
Can you send pythondata-cpu-naxriscv/pythondata_cpu_naxriscv/verilog/NaxRiscvLitex*.v ?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I still get (* ram_style = "block" *) reg [50:0] BtbPlugin_logic_mem [0:511]; The point is to figure out what you are running exactly, so, realy need to check that on your generated verilog files. |
Sorry for keeping you waiting for so long |
dear dolu,I try to use the v file to test, this file BtbPlugin_logic_mem is [0:511],but the result dhrystone is 1.18 |
I will also send you the waveform of this v file. Could you please take a look at other issues
段玖龙
***@***.***
…------------------ 原始邮件 ------------------
发件人: "SpinalHDL/NaxRiscv" ***@***.***>;
发送时间: 2024年6月7日(星期五) 晚上7:04
***@***.***>;
***@***.******@***.***>;
主题: Re: [SpinalHDL/NaxRiscv] about litex and dhrystone (Issue #96)
I still get (* ram_style = "block" *) reg [50:0] BtbPlugin_logic_mem [0:511];
The point is to figure out what you are running exactly, so, realy need to check that on your generated verilog files.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
从QQ邮箱发来的超大附件
vcd.zip (1.42G, 2024年07月07日 21:22 到期)进入下载页面:https://mail.qq.com/cgi-bin/ftnExs_download?k=096430395f806dc351034c04443502494d10510c5b5701561806530b0418075151001d0b0601074b040702005701515e5052075d6232301056001e430b45305b&t=exs_ftn_download&code=5d09b50f
|
Thanks, waiting for it. |
https://mail.qq.com/cgi-bin/ftnExs_download?k=096430395f806dc351034c04443502494d10510c5b5701561806530b0418075151001d0b0601074b040702005701515e5052075d6232301056001e430b45305b&t=exs_ftn_download&code=5d09b50f |
Two things :
|
1-
The program for dhrystone is based on the source files in your ext/Maxsofware directory, and then modifies the serial port printing function and timer function to obtain the elf file. The other source codes have not changed, and the makefile is also a makefile mainly composed of asm.mk in the common directory. I only used the rv32 compiler, and the rest have not changed
2-
Do I need to add a c to the arch parameter?
发自我的iPhone
…------------------ Original ------------------
From: Dolu1990 ***@***.***>
Date: Tue,Jun 11,2024 7:34 PM
To: SpinalHDL/NaxRiscv ***@***.***>
Cc: duanjiulon ***@***.***>, Author ***@***.***>
Subject: Re: [SpinalHDL/NaxRiscv] about litex and dhrystone (Issue #96)
Two things :
The CPU is getting a lot of store to load hazards, how did you compiled the dhrystone benchmark ? (exactly, also can you send the elf ?)
The benchmark results given in the doc are without RVC, your software is running with RVC
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
The first v file sent to you has rvc, while the second one does not
发自我的iPhone
…------------------ Original ------------------
From: Dolu1990 ***@***.***>
Date: Tue,Jun 11,2024 7:34 PM
To: SpinalHDL/NaxRiscv ***@***.***>
Cc: duanjiulon ***@***.***>, Author ***@***.***>
Subject: Re: [SpinalHDL/NaxRiscv] about litex and dhrystone (Issue #96)
Two things :
The CPU is getting a lot of store to load hazards, how did you compiled the dhrystone benchmark ? (exactly, also can you send the elf ?)
The benchmark results given in the doc are without RVC, your software is running with RVC
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
DEBUG?=yes You need to turn that to no. |
what you mean is argument -O3? |
Dear dulo,Do you still have the V-files of the waveforms I sent to you on your computer? I recently changed my computer and couldn't find those ones ,zhanks |
Hi,
It mean optimization level 3 (maximum speed)
I'm in a travel, will be back the 18, will be able to check then, not sure. |
thanks so much,I’ve found it。
|
I just followed the whole https://github.com/SpinalHDL/NaxRiscv/blob/main/src/test/cpp/naxriscv/README.md#how-to-setup-things with a fresh clone, all went well. |
Hi,dear dolu,
I am currently learning how to use the kernel generated by Litex to run the dhrystone algorithm on SOC. The specific operation is: 1. Generate a SOC system with a Nax core, and then based on the dhrystone source code and simulation steps provided by you in your Naxriscv, set the starting address of the linker script to 0x0000000. This address is the address of the ROM or sram, which can run the program. However, once the drystone program is loaded, it freezes and cannot obtain the corresponding results in Verilator, May I ask why this is? Is it because I lack any environmental dependencies?
The text was updated successfully, but these errors were encountered: