Infrastructure design & implementation of MIPS processors for students lab based on Bluespec HDL Students: Danny Hofshi, Shai Shachrur Supervisor: Mony Orbach Winter 2012
FPGA Bluespec Scemi Bluespec HDL C++ \ Perl What we did ? Xilinx FPGA MIPS
Project Goals Creating the Laboratory working environment. Creating varied types of MIPS architectures: - Multi-cycle - Pipelined (forwarding, Branch predictor, Cache). - Testing & debugging. Documentation and lab flow walkthrough.
Project tools Bluespec SCEMI C++ PERL Plan ahead Xiling Virtix 5 FPGA.
The multi-cycle MIPS
The pipelined MIPS
Emulation flow PCIe cable Virtex 5 FPGA Linux Environment
Write Assembler Code & Data memory Type executable command Receive performances and data addi $t1 $zero 2 addi $t2 $zero 2 add $t3 $t1 $t2 sw $t3 $zero 0 stop Compiler Communication module C++ MIPS Data received Simulation flow
Simple example Student #1Student #2 Assembly Code addi $t0 $zero 1 addi $t1 $zero 2 addi $t2 $zero 3 addi $t3 $zero 4 add $s0 $t0 $t1 add $s0 $s0 $t2 add $s0 $s0 $t3 sw $s0 $zero 0 stop addi $t0 $zero 1 addi $t1 $zero 2 addi $t2 $zero 3 addi $t3 $zero 4 add $s0 $t0 $t1 add $s1 $t2 $t3 add $s2 $s0 $s1 sw $s2 $zero 0 stop
Test your processor Code #1Code #2 Number of instructions to run 99 Arithmetic equation $s0 = $to + $t1 + $t2 + $t3 $s2 = $to + $t1 + $t2 + $t3 Who do you think will win, the Multi-cycle run test? ? Who do you think will win, the Pipeline run test? ? Who do you think will win, the Pipeline + forwarding test? ?
Test your processor PROC3PROC2PROC1ProgramParameter 999Add V1Number of instructions Number of cycles 999Add V2Number of instructions Number of cycles Machine output
Libraries content Perl: compiler for Assembly code Sim: Simulation compile environment to test the Mips designs on TCP\IP communication FPGA: Emulation build environment to test the Mips designs on PCIe communication SRC: Bluespec source codes for 9 different architecture combinations TB: C++ Test Bench communica tion code. LAB 1 PROC#1: Bit file PROC#2: Bit file PROC#3: Bit file ProgramsAssembly LAB 2 PROC#1: Bit file PROC#2: Bit file PROC#3: Bit file ProgramsAssembly Project source codes FINALDIRECTORYFINALDIRECTORY
Conclusions Conclusions regarding using Bluespec as preferred language. Conclusion regarding Scemi Conclusion regarding the lab.
Bluespec HDL During code writing of bluespec we encountered with some issue’s in the language, for example:
Bluespec HDL If in some clock cycle, y2=a, x2=b We would expect that in the next cycle: y2 = b+1 x2= a+1 However, bluespec always sequence all the rules which are fired in the same clock cycle. In Bluespec, if a register (x2,y2) appears in more then one rule. The rule which reads the register will always fire before the rule that updates the register.
Bluespec HDL In our example, rule r2a must fire before rule r2b because r2a reads y2 value and r2b updates y2 value. rule r2b must fire before rule r2a because r2b reads x2 value and r2a updates x2 value.
Bluespec HDL This scenario is treated as a conflict by the compiler And the scheduler will choose only one of the rules to fire. We encountered this situation in many places in our design and had use various workaround’s.
Bluespec HDL Conclusion: Writing methodology should be developed for writing bluespec HDL which can utilize the advantages of the language.
Bluespec HDL Debugging : There are only 2 ways available to debug Bluespec -Waveform of the verilog compilation output -Using $display Bluespec does not provide proper debug method that works in the same abstraction level as the code development
Scemi Scemi enabled us to create “click of a button” interface between hardware in software. However, Scemi makes it difficult using other periphery devices on the FPGA board. In addition, in most platforms, a reboot is required after a bit-stream is loaded to the FPGA.
Scemi Conclusion: consider developing USB interface with platform coupled with generic software that will replace SCEMI functionality, thus eliminating both problems.
Thank you !