|
QuickstartGuide
Quickstart Guide for XUP V2P FPGA BoardThis is a quickstart guide to easily deploy ρ-VEX, mainly focused on the utilization with a Xilinx University Program Virtex-II Pro FPGA board by Digilent. If you want to use this guide together with another FPGA platform, you should first add the definitions of your board to the workflow as described later. Table of ContentsRequirements
1 When you want to make use of the Makefile method described below on a Windows machine, a Cygwin installation should be present with GNU Make. Xilinx EDK automatically installs a version of Cygwin. However, some GNU tools like cat are not included. This results in an error while bundling the log files after synthesis. This can be safely ignored. Quickstart - Deploying ρ-VEX on an FPGA
make v2p make fpga By default, an application to calculate the 45th Fibonacci number is loaded and pre-synthesized. The VEX assembly source file of the default application is fibonacci.s, which can be found in the demos directory. The output of ρ-VEX transmitted over the UART is the following: r-VEX ----- Cycles: 0x00000231 Data memory dump addr | contents -----+----------- 0x00 | 0x43A53F82 0x01 | 0x00000000 0x02 | 0x00000000 0x03 | 0x00000000 0x04 | 0x00000000 0x05 | 0x00000000 0x06 | 0x00000000 0x07 | 0x00000000 0x08 | 0x00000000 0x09 | 0x00000000 0x0A | 0x00000000 0x0B | 0x00000000 0x0C | 0x00000000 0x0D | 0x00000000 0x0E | 0x00000000 0x0F | 0x00000000 Assembling and Running Other CodeThe instruction memory ROM can be found in the file i_mem.vhd. A new instruction ROM file can be generated by the ρ-ASM tool. This tool requires a UNIX operating system with the GNU C libraries.
make ./rasm <source.s> mv i_mem.vhd ../../r-VEX/src/ To see more options of ρ-ASM (like enabling debug output) run the application without any arguments. Some demo applications with their corresponding outputs can be found in the demos directory. Using ρ-OPSThis guide on adding ρ-OPS to an ρ-VEX implementation is based on the example of adding the FIB3 and FIB4 operations, as used in our Fibonacci's Sequence benchmark application. Adapting ρ-VEX
constant ALU_FIB4 : std_logic_vector(6 downto 0) := "1000010"; constant ALU_FIB3 : std_logic_vector(6 downto 0) := "1101100"; alu_control : process(clk, reset) begin if (reset = '1') then out_valid <= '0'; result_s <= (others => '0'); cout_s <= '0'; elsif (clk = '1' and clk'event) then ... elsif std_match(aluop, ALU_FIB4) then result_s <= f_FIB4 (src1, src2); elsif std_match(aluop, ALU_FIB3) then result_s <= f_FIB3 (src1, src2); ... end if; end process alu_control; function f_FIB4 ( s1, s2 : std_logic_vector(31 downto 0))
return std_logic_vector;
function f_FIB3 ( s1, s2 : std_logic_vector(31 downto 0))
return std_logic_vector;
...
function f_FIB4 ( s1, s2 : std_logic_vector(31 downto 0))
return std_logic_vector is
begin
return (s1 + s2 + s2 + s1 + s2 + s2 + s1 + s2);
end function f_FIB4;
function f_FIB3 ( s1, s2 : std_logic_vector(31 downto 0))
return std_logic_vector is
begin
return (s1 + s2 + s2 + s1 + s2);
end function f_FIB3;Adapting ρ-ASMTo adapt ρ-ASM to support the new ρ-OPS, two small additions should be made in syllable.h. A new opcode define should be made, as well as an addition of the new opcode's mnemonic to the operation_table lookup table (lines 11 - 12). #define FIB3 108
#define FIB4 66
...
static struct operation_t {
const char *operation;
int opcode;
} operation_table[] = {
...
{ "fib3", FIB3 },
{ "fib4", FIB4 },
...
};Running Modelsim SimulationsTo run Modelsim simulations within the workflow, you should have installed a version of Mentor Graphics Modelsim (we simulated with the SE 6.3d edition). To run the simulations using the system wrapper testbench r-VEX/testbenches/tb_system.vhd (which simulates the execution of the current instruction memory in i_mem.vhd), enter the following command in r-VEX/src/: make modelsim Adding Support For Other FPGA BoardsTo add support for other FPGA boards with Xilinx a FPGA in this workflow, the file r-VEX/src/Makefile should be edited. The following changes should be applied:
XIL_PART_r-vex_<mnemonic> = <xilinx_identifier> <mnemonic>: r-vex_<mnemonic>.deps r-vex_<mnemonic>.bit log_<mnemonic>.txt 2As a reference, you could use the Make target with the mnemonic v2p. |