ucb-bar/sha3

SHA3 rocc template compilation error

Closed this issue · 10 comments

Hi,

when trying to integrate the SHA3 rocc into the latest rocket chip (rev 25e1412) I get the following error during compilation o the emulator

~/git-rocket-chip/emulator$ make CONFIG=Sha3CPPConfig
cd /home/lowrisc/git-rocket-chip && java -Xmx2048M -Xss8M -XX:MaxPermSize=128M -jar sbt-launch.jar "project rocketchip" "elaborate Top --W0W --noIoDebug --backend c --configInstance rocketchip.Sha3CPPConfig --compileInitializationUnoptimized --targetDir emulator/generated-src"
[info] Loading project definition from /home/lowrisc/git-rocket-chip/project
[info] Found addon: rocc-template
[info] Set current project to rocketchip (in build file:/home/lowrisc/git-rocket-chip/)
[info] Set current project to rocketchip (in build file:/home/lowrisc/git-rocket-chip/)
[info] Compiling 11 Scala sources to /home/lowrisc/git-rocket-chip/.addons-dont-touch/target/scala-2.10/classes...
[error] /home/lowrisc/git-rocket-chip/.addons-dont-touch/src/main/scala/rocc-template/test_infrastructure.scala:346: value finish is not a member of uncore.ClientUncachedTileLinkIO
[error] io.imem.finish.valid := Bool(false)
[error] ^
[error] one error found
error Compilation failed
[error] Total time: 8 s, completed 21.07.2015 16:39:56
make: *** [generated-src/Top.Sha3CPPConfig.h] Fehler 1

Are there any changes in scala not reflected by the rocc template?
Best regards,
Carsten

Hi,
I have a fork of the sha3 rocc template which seems to work with the latest
tilelink updates. You can try it from here:
https://github.com/kionix/rocc-template

On Tue, Jul 21, 2015 at 7:12 PM, crolfes notifications@github.com wrote:

Hi,

when trying to integrate the SHA3 rocc into the latest rocket chip (rev
25e1412) I get the following error during compilation o the emulator

~/git-rocket-chip/emulator$ make CONFIG=Sha3CPPConfig
cd /home/lowrisc/git-rocket-chip && java -Xmx2048M -Xss8M
-XX:MaxPermSize=128M -jar sbt-launch.jar "project rocketchip" "elaborate
Top --W0W --noIoDebug --backend c --configInstance rocketchip.Sha3CPPConfig
--compileInitializationUnoptimized --targetDir emulator/generated-src"
[info] Loading project definition from
/home/lowrisc/git-rocket-chip/project
[info] Found addon: rocc-template
[info] Set current project to rocketchip (in build
file:/home/lowrisc/git-rocket-chip/)
[info] Set current project to rocketchip (in build
file:/home/lowrisc/git-rocket-chip/)
[info] Compiling 11 Scala sources to
/home/lowrisc/git-rocket-chip/.addons-dont-touch/target/scala-2.10/classes...
[error]
/home/lowrisc/git-rocket-chip/.addons-dont-touch/src/main/scala/rocc-template/test_infrastructure.scala:346:
value finish is not a member of uncore.ClientUncachedTileLinkIO
[error] io.imem.finish.valid := Bool(false)
[error] ^
[error] one error found
error http://addons/compile:compile Compilation failed
[error] Total time: 8 s, completed 21.07.2015 16:39:56
make: *** [generated-src/Top.Sha3CPPConfig.h] Fehler 1

Are there any changes in scala not reflected by the rocc template?
Best regards,
Carsten


Reply to this email directly or view it on GitHub
#1.

Thanks.
Now I am able to build the emulator with the SHA3 rocc and run a benchmark.
~/git-rocket-chip/rocc-template/tests$ ../../emulator/emulator-Sha3CPPConfig pk -s sha3-rocc-bm.rv
122569 cycles

But when I try to run the test-makefile the opcode 'custom0' is unrecognized.
~/git-rocket-chip/rocc-template/tests$ make all
riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFDXhwacha -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -DPREALLOCATE=1 -DHOST_DEBUG=0
-c -I../../riscv-tools/riscv-tests/benchmarks/../env -I../../riscv-tools/riscv-tests/benchmarks/common -I../../riscv-tools/riscv-tests/benchmarks/sha3 sha3-rocc-bm.c -o sha3-rocc-bm.o
sha3-rocc-bm.c: Assembler messages:
sha3-rocc-bm.c:28: Error: unrecognized opcode custom0 0,s2,s1,0' sha3-rocc-bm.c:32: Error: unrecognized opcodecustom0 0,a5,0,1'
make: *** [sha3-rocc-bm.o] Fehler 1

Furthermore, the asm tests got stuck.
~/git-rocket-chip/emulator$ make CONFIG=Sha3CPPConfig run-asm-tests
./emulator-Sha3CPPConfig +dramsim +max-cycles=100000000 +verbose +loadmem=output/rv64ui-v-ori.hex none 3>&1 1>&2 2>&3 | /home/lowrisc/git-rocket-chip/riscv/bin/spike-dasm > output/rv64ui-v-ori.out && [ $PIPESTATUS -eq 0 ]

Do you have any idea how to fix this?

Use the latest gnu toolchain (from the new_priviledged_isa branch). There
was a bug in some older commits that failed to pass Xcustom to the gcc
assembler. It's been fixed now.

On Wed, Jul 22, 2015 at 12:43 PM, crolfes notifications@github.com wrote:

Thanks.
Now I am able to build the emulator with the SHA3 rocc and run a benchmark.
~/git-rocket-chip/rocc-template/tests$
../../emulator/emulator-Sha3CPPConfig pk -s sha3-rocc-bm.rv
122569 cycles

But when I try to run the test-makefile the opcode 'custom0' is
unrecognized.
~/git-rocket-chip/rocc-template/tests$ make all
riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFDXhwacha -std=gnu99 -O2
-ffast-math -fno-common -fno-builtin-printf -DPREALLOCATE=1 -DHOST_DEBUG=0
-c -I../../riscv-tools/riscv-tests/benchmarks/../env
-I../../riscv-tools/riscv-tests/benchmarks/common
-I../../riscv-tools/riscv-tests/benchmarks/sha3 sha3-rocc-bm.c -o
sha3-rocc-bm.o
sha3-rocc-bm.c: Assembler messages:
sha3-rocc-bm.c:28: Error: unrecognized opcode custom0 0,s2,s1,0'
sha3-rocc-bm.c:32: Error: unrecognized opcodecustom0 0,a5,0,1'
make: *** [sha3-rocc-bm.o] Fehler 1

Furthermore, the asm tests got stuck.
~/git-rocket-chip/emulator$ make CONFIG=Sha3CPPConfig run-asm-tests
./emulator-Sha3CPPConfig +dramsim +max-cycles=100000000 +verbose
+loadmem=output/rv64ui-v-ori.hex none 3>&1 1>&2 2>&3 |
/home/lowrisc/git-rocket-chip/riscv/bin/spike-dasm >
output/rv64ui-v-ori.out && [ $PIPESTATUS -eq 0 ]

Do you have any idea how to fix this?


Reply to this email directly or view it on GitHub
#1 (comment)
.

Ok. Using the latest toolchain from the new_privileged_isa (commit b8ae68020) I can build the rsicv-tools.
Running the spike simulator with the SHA3 HW test is ok, too.

~/git-rocket-chip/rocc-template/tests$ spike --extension=sha3 pk sha3-rocc.rv 
start basic test 1.
...
success!

But the compilation of the rocc test still fails.

~/git-rocket-chip/rocc-template/tests$ make all
riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFDXhwacha -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -DPREALLOCATE=1 -DHOST_DEBUG=0 \
                 -c -I../../riscv-tools/riscv-tests/benchmarks/../env -I../../riscv-tools/riscv-tests/benchmarks/common -I../../riscv-tools/riscv-tests/benchmarks/sha3 sha3-rocc-bm.c -o sha3-rocc-bm.o
sha3-rocc-bm.c: Assembler messages:
sha3-rocc-bm.c:28: Error: unrecognized opcode `custom0 0,s2,s1,0'
sha3-rocc-bm.c:32: Error: unrecognized opcode `custom0 0,a5,0,1'
make: *** [sha3-rocc-bm.o] Fehler 1

use -march=RVIMAFDXcustom gcc switch instead. I have included a Makefile in
my repository which uses the riscv-test benchmarks build system, syscalls,
and link script.

On Wed, Jul 22, 2015, 17:31 crolfes notifications@github.com wrote:

Ok. Using the latest toolchain from the new_privileged_isa (commit
b8ae68020) I can build the rsicv-tools.
Running the spike simulator with the SHA3 HW test is ok, too.

~/git-rocket-chip/rocc-template/tests$ spike --extension=sha3 pk sha3-rocc.rv
start basic test 1.
...
success!

But the compilation of the rocc test still fails.

~/git-rocket-chip/rocc-template/tests$ make all
riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFDXhwacha -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -DPREALLOCATE=1 -DHOST_DEBUG=0
-c -I../../riscv-tools/riscv-tests/benchmarks/../env -I../../riscv-tools/riscv-tests/benchmarks/common -I../../riscv-tools/riscv-

tests/benchmarks/sha3 sha3-rocc-bm.c -o sha3-rocc-bm.o
sha3-rocc-bm.c: Assembler messages:
sha3-rocc-bm.c:28: Error: unrecognized opcode custom0 0,s2,s1,0' sha3-rocc-bm.c:32: Error: unrecognized opcodecustom0 0,a5,0,1'
make: *** [sha3-rocc-bm.o] Fehler 1


Reply to this email directly or view it on GitHub
#1 (comment)
.

@kionix would you be ok if I pulled your changes into this repo?

Thank you kionix.
Simulation and compilation problems seem to be solved with your modifications.

Has anyone sucessfully integrated the SHA3 core into the zedboard fpga design?

I updated the rocket chip git repository to the latest version (c2ad0b7). Seems that the ROCC interface has changed. Now, even the emulator with the SHA-fix branch included does not build correct.
During compilation there are several warnings. When running the sha3-rocc.rv test there is no output. The SHA3 SW only test is running fine.
Where can I find a detailed description of the ROCC interface? In the latest GIT code you need to set a system environment variable, otherwise the ROCC template will not be detected.

export ROCKETCHIP_ADDONS=rocc-template

Here is the output during compilation of the emulator

~/git-rocket-chip/emulator$ make CONFIG=Sha3CPPConfig
cd /home/lowrisc/git-rocket-chip && java -Xmx2048M -Xss8M -XX:MaxPermSize=128M -jar sbt-launch.jar "project rocketchip" "run Top --W0W --minimumCompatibility 3.0.0 --backend c --configInstance rocketchip.Sha3CPPConfig --compileInitializationUnoptimized --targetDir /home/lowrisc/git-rocket-chip/emulator/generated-src --noIoDebug"
[info] Loading project definition from /home/lowrisc/git-rocket-chip/project
Using addons: rocc-template
[info] Set current project to rocketchip (in build file:/home/lowrisc/git-rocket-chip/)
[info] Set current project to rocketchip (in build file:/home/lowrisc/git-rocket-chip/)
[info] Running rocketchip.TestGenerator Top --W0W --minimumCompatibility 3.0.0 --backend c --configInstance rocketchip.Sha3CPPConfig --compileInitializationUnoptimized --targetDir /home/lowrisc/git-rocket-chip/emulator/generated-src --noIoDebug
Generated Address Map
    mem 0 - 3fffffff
    conf:csr0 40000000 - 40007fff
    conf:scr 40008000 - 400081ff
    io 80000000 - ffffffff
CPP elaborate
...
CppBackend: createCppFile Top.Sha3CPPConfig-0.cpp
CppBackend: createCppFile Top.Sha3CPPConfig-1.cpp
CppBackend: createCppFile Top.Sha3CPPConfig-2.cpp
[warn] tilelink.scala:938: UNABLE TO FIND client_id IN <ManagerTileLinkNetworkPort (class uncore.ManagerTileLinkNetworkPort)> in class uncore.ManagerTileLinkNetworkPort
[warn] tilelink.scala:940: UNABLE TO FIND client_id IN <ManagerTileLinkNetworkPort (class uncore.ManagerTileLinkNetworkPort)> in class uncore.ManagerTileLinkNetworkPort
[warn] nbdcache.scala:493: UNABLE TO FIND data IN <replay_arb (class Chisel.Arbiter)> in class rocket.MSHRFile
[warn] ctrl.scala:80: Mem(out:T, n:Int) is deprecated. Please use Mem(n:Int, t:T) instead. in class sha3.CtrlModule
[warn] ctrl.scala:80: Mem(..., seqRead) is deprecated. Please use SeqMem(...) in class sha3.CtrlModule
[warn] ctrl.scala:82: Vec(Reg) is deprecated. Please use Reg(Vec) in class sha3.CtrlModule
[warn] ctrl.scala:107: Vec(Reg) is deprecated. Please use Reg(Vec) in class sha3.CtrlModule
[warn] dpath.scala:31: Vec(Reg) is deprecated. Please use Reg(Vec) in class sha3.DpathModule
[warn] sha3.scala:68: UNABLE TO FIND buffer_out IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND busy IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_req_addr IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_req_cmd IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_req_rdy IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_req_tag IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_req_typ IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_req_val IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_resp_data IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_resp_tag IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND dmem_resp_val IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND rocc_funct IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND rocc_rd IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND rocc_req_rdy IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND rocc_req_val IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND rocc_rs1 IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND rocc_rs2 IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] sha3.scala:68: UNABLE TO FIND windex IN <dpath (class sha3.DpathModule)> in class sha3.Sha3Accel
[warn] nbdcache.scala:1072: Bulk-connection to a node that has been procedurally assigned-to is deprecated. in class rocket.SimpleHellaCacheIF
[warn] nbdcache.scala:1072: Bulk-connection to a node that has been procedurally assigned-to is deprecated. in class rocket.SimpleHellaCacheIF
[warn] nbdcache.scala:1072: Bulk-connection to a node that has been procedurally assigned-to is deprecated. in class rocket.SimpleHellaCacheIF
[warn] nbdcache.scala:1095: Bulk-connection to a node that has been procedurally assigned-to is deprecated. in class rocket.SimpleHellaCacheIF
[warn] nbdcache.scala:1095: UNABLE TO FIND kill IN <SimpleHellaCacheIF (class rocket.SimpleHellaCacheIF)> in class rocket.SimpleHellaCacheIF
[warn] nbdcache.scala:1095: UNABLE TO FIND phys IN <SimpleHellaCacheIF (class rocket.SimpleHellaCacheIF)> in class rocket.SimpleHellaCacheIF
[warn] tile.scala:59: UNABLE TO FIND probe IN <icache (class rocket.Frontend)> in class rocket.RocketTile$$anonfun$11
[warn] tile.scala:59: UNABLE TO FIND release IN <icache (class rocket.Frontend)> in class rocket.RocketTile$$anonfun$11
[warn] tile.scala:60: UNABLE TO FIND probe IN <Sha3Accel (class sha3.Sha3Accel)> in class rocket.RocketTile$$anonfun$11
[warn] tile.scala:60: UNABLE TO FIND release IN <Sha3Accel (class sha3.Sha3Accel)> in class rocket.RocketTile$$anonfun$11
[warn] tile.scala:61: UNABLE TO FIND probe IN <Sha3Accel (class sha3.Sha3Accel)> in class rocket.RocketTile$$anonfun$11
[warn] tile.scala:61: UNABLE TO FIND release IN <Sha3Accel (class sha3.Sha3Accel)> in class rocket.RocketTile$$anonfun$11
[warn] ctrl.scala:87: Chisel3 compatibility: node buffer_waddr should be wrapped in a Wire() in class sha3.CtrlModule
[warn] ctrl.scala:89: Chisel3 compatibility: node buffer_wdata should be wrapped in a Wire() in class sha3.CtrlModule
[warn] ctrl.scala:85: Chisel3 compatibility: node buffer_wen should be wrapped in a Wire() in class sha3.CtrlModule
[warn] theta.scala:25: Chisel3 compatibility: nodes , , , ,  should be wrapped in a Wire() in class sha3.ThetaModule$$anonfun$2
[warn] theta.scala:20: Chisel3 compatibility: nodes bc_4, bc_1, bc_0, bc_3, bc_2 should be wrapped in a Wire() in class sha3.ThetaModule$$anonfun$1
[warn] rhopi.scala:40: Chisel3 compatibility: node  should be wrapped in a Wire() in class sha3.RhoPiModule$$anonfun$1$$anonfun$apply$mcVI$sp$1
[warn] rhopi.scala:42: Chisel3 compatibility: nodes , , , , , , , , , , , , , , , , , , , , , , ,  should be wrapped in a Wire() in class sha3.RhoPiModule$$anonfun$1$$anonfun$apply$mcVI$sp$1
[warn] nbdcache.scala:1051: Chisel3 compatibility: node replaying_cmb should be wrapped in a Wire() in class rocket.SimpleHellaCacheIF
[warn] Testing.scala:128: Width.op- setting width to Width(0): 1 < 10 in class rocketchip.TestGenerator$
[success] Total time: 16 s, completed 05.10.2015 12:34:01


I'm looking into this issue. It has to do with recent updates to chisel.

fixed with master commit 67ad36d74a1c7604792d0a751c013d70eee2a3a9