Fpga Lab Journal 11-14
Fpga Lab Journal 11-14
Implementation of Processor
Objective:
1. The objective of this lab is to join a program counter, instruction memory and register
files modeled in previous lab with ALU and Controller to create a processor.
2. Write few instructions in Instr. Memory and execute the processor.
Equipment/Tool:
Vivado Software
Computer
Background:
Figure below shows the complete diagram of the small processor. In the previous lab we made
counter, instruction memory and register files along with ALU and Controller. In this lab we
must instantiate already made components and join them in top level file.
To add the values in <3 Bit - Instruction><4 bit - location in register file 1 to read first
one of the registers of operand><4 bit - location in register file 2 to read second operand><1 bit
register file 1 with one - register file where to store><4 bit - location in specified register
of the registers of file><16bit - don't care>
register file 2 and store
the result at one of the Example: 010011101010 0100 XXXXXXXXXXXXXXXX
locations in one of the Add content of data placed at location 0111 of register file 1 with data
register files placed at location 0101 and place it at location 0100 of register file 0.
To subtract the values <3 Bit - Instruction><4 bit - location in register file 1 to read first
in one of the registers operand><4 bit - location in register file 2 to read second operand><1 bit
of register file 1 with - register file where to store><4 bit - location in specified register
one of the registers of file><16bit - don't care>
register file 2 and store
the result at one of the Example: 011 011101010 0100 XXXXXXXXXXXXXXXX
locations in one of the Subtract content of data placed at location 0111 of register file 1 with data
register files. placed at location 0101 and place it at location 0100 of register file 0.
To Bitwise-xor the <3 Bit - Instruction><4 bit - location in register file 1 to read first
values in one of the operand><4 bit - location in register file 2 to read second operand><1 bit
registers of register file - register file where to store><4 bit - location in specified register
1 with one of the file><16bit - don't care>
registers of register file
2 and store the result at Example: 100 011101010 0100 XXXXXXXXXXXXXXXX
one of the locations in Bitwise-xor content of data placed at location 0111 of register file 1 with
one of the register files data placed at location 0101 and place it at location 0100 of register file 0.
To Bitwise-and the <3 Bit - Instruction><4 bit - location in register file 1 to read first
values in one of the operand><4 bit - location in register file 2 to read second operand><1 bit
registers of register file - register file where to store><4 bit - location in specified register
1 with one of the file><16bit - don't care>
registers of register file
2 and store the result at Example: 101 011101010 0100XXXXXXXXXXXXXXXX
one of the locations in Bitwise-and content of data placed at location 0111 of register file 1 with
one of the register files. data placed at location 0101 and place it at location 0100 of register file 0.
To multiply the values <3 Bit - Instruction><4 bit - location in register file 1 to read first
in one of the registers operand><4 bit - location in register file 2 to read second operand><1 bit
of register file 1 with - register file where to store MSB><4 bit - location in specified register
one of the registers of file><4 bit - location in specified register file><12bit - don't care>
register file 2 and store
the 24 MSBs of results Example: 101 011101010 01001001XXXXXXXXXXXX
in one of the locations Multiply content of data placed at location 0111 of register file 1 with data
in one of the register placed at location 0101 in register file 2 and place 24 bit MSB of result at
files and 24 LSBs in location 0100 of register file 0 and 24-LSB of results at location 1001 of
one of the locations in register file 2.
other register files.
Task3:
Make test bench to simulate the design.
Code
Simulations
Conclusion…………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
EXPERIMENT 12
Implementation of Programmable Logic (PL)
Objective:
Create a Vivado Project for a Zynq System.
Project creation in Vivado IP Integrator.
Generating HDL wrapper of block design and and generating of bit stream for PL
portion.
Programming Processor and FPGA using SDK tool.
Equipment/Tool:
Vivado Software
Computer
ZedBoard
Background:
This lab guides you through the process of using Vivado to create a simple ARM Cortex-A9
based processor design targeting the ZC702 board. You will use Vivado to create the hardware
system and SDK (Software Development Kit) to create an example application to verify the
hardware functionality.
Procedure/Tasks:
Create a Project Using Vivado.
Create Processing System Using IP Integrator.
Generate Top Level HDL and Export to SDK.
Create a new file in SDK and select Hello World.
Follow training manual to execute all above steps in VIVADO and SDK.
Task 1:
In this lab we will first print Hello World in SDK terminal.
Secondly implement a basic OR gate also write it constraint file.
Program task on Zed Board.
Code: (Hello World and OR Gate)
IP Integrator Diagram
Results
Conclusion…………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
EXPERIMENT 13
Implementation of Programmable Logic (PL) and Processing System (PS)
Objective:
Create a Vivado Project for a Zynq System
Project creation in Vivado IP Integrator
Generating HDL wrapper of block design and and generating of bit stream for PL portion
Exporting design to Software Development Kit
Software application development
Programming Processor and FPGA using SDK tool
Equipment/Tool:
Vivado Software
Computer
Zed Board
Background:
PL stands for Programmable Logic, which is FPGA. In a Zynq device the PS or processing
system (cortex a9) is connected to the programmable logic using the AXI buses. That means
peripherals implemented in PL can communicate easily with software running on the CPU. This
lab guides you through the process of using Vivado to create a simple ARM Cortex-A9 based
processor design targeting the ZC702 board. You will use Vivado to create the hardware system
and SDK (Software Development Kit) to create an example application to verify the hardware
functionality.
Procedure/Tasks:
This lab is separated into steps that consist of general overview statements that provide
information on the detailed instructions that follow. Follow these detailed instructions to
progress through the lab. This lab comprises 4 primary steps:
You will create a top-level project using Vivado.
Create the processor system using the Vivado IP Integrator.
Generate the top-level HDL and export the design to SDK.
Create a simple NAND Gate based application, and finally, test in hardware.
Follow training manual to execute all above steps in VIVADO and SDK.
Task 1:
Implement NAND gate on Zed Board.
AND gate is implemented through PL and NOT gate is implemented through PS.
int main()
{
init_platform();
XGpio input, output;
int a;
int y;
XGpio_Initialize(&input, XPAR_AXI_GPIO_1_DEVICE_ID);
XGpio_Initialize(&output, XPAR_AXI_GPIO_0_DEVICE_ID);
XGpio_SetDataDirection(&input,1,1);
XGpio_SetDataDirection(&output,1,0);
print("Done");
while(1)
{
a= XGpio_DiscreteRead(&input,1);
if (a==1)
{
y=0;
}
else
{
y=1;
}
XGpio_DiscreteWrite(&output,1,y);
}
cleanup_platform();
return 0;
}
Code: (Verilog AND Gate)
IP Integrator Diagram
Results
Conclusion…………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
EXPERIMENT 14
Open Ended Lab
Code
Simulations
Conclusion…………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
………………………………………………………………………………………………………
Lab Rubrics
FPGA Based System Design (Spring’23)