Saturday, March 5, 2011

Procedure : writing and burning the PICOBLaze assembly code onto the FPGA board.

Here is the general procedure that is followed to burn an assembly code onto the Pico Blaze MC.


1. Write your own ROM program by learning the PicoBlaze instruction sets.  
2.  Compile  the  program  to  VHDL  by  using  KCPSM  assembler  (This
assembler  requires  32­bit  operating  system)

3. Synthesize the VHDL program and the PicoBlaze soft code in ISE.
4. Generate bit file (You also need to include your modified UCF file).  
5. Download the bit file to the FPGA and check if that works.



You can find the detailed procedure in the manual that comes along with the downloads (last post). Read page 40 of the KCPSM manual on how to use the KCPSM assembler.


STEP BY STEP PROCEDURE

Problem Statement : Run the following  assembly program on the FPGA Board (we dont care about the output just  burning the program onto the soft MC)
loop : INPUT s2,00
          OUTPUT s2,00
jump loop
Steps
1. Save the assembly code in a file called "Prog_rom.psm" (file name important)
2. Use windows DOS box and follow the instructions in the page 40 of the KCPSM manualon how to compile the program

3. After compiling the program, the output is a file called "Prog_rom.vhd" (a Prog_rom.v file is also generated I am assuming you are using VHDL)

4. Open a ISE project and add the following file that come with the downloaded kcpsm zip file
        a. embedded_kcpsm3.vhd
        b. kcpsm3.vhd
        c. Prog_rom.vhd (generated by the assembler)
        (if you are using vhdl. there are verilog files also available)


5. Modifying the ucf file of your FPGA
       a. change the names of the nets in the UCF file corresponding to the ports in the top level entity in "embedded_kcpsm3.vhd".
      b. Since it is a basic test, I changed the switches in my UCF to in_ports and Seven segment led nets to out_ports

6. Synthesize, translate, place and route

7. Generate the bit stream.


Note: KCPSM is a windows executable. Usually wine takes care of running windows executables but shows some wierd error in this case. The quickest fix according the google is using DOSemu (Dos emulator). I am yet to try if KCPSM is working in DOSemu. Will try and post the results soon.


Friendly neighborhood Abishek.

No comments:

Post a Comment