├── Image
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.jpg
├── 6.jpg
└── 7.jpg
├── XUP
└── Image
│ ├── 2.png
│ ├── 3.png
│ ├── 5.jpg
│ ├── 6.jpg
│ └── 7.jpg
├── CPU_ON_BOARD
├── procedure.vsdx
├── buttons_function.xlsx
├── CPU_ON_BOARD.srcs
│ └── sources_1
│ │ └── bd
│ │ └── MIPS_CPU
│ │ ├── ip
│ │ └── MIPS_CPU_clk_wiz_0_0
│ │ │ ├── MIPS_CPU_clk_wiz_0_0_board.xdc
│ │ │ ├── MIPS_CPU_clk_wiz_0_0_ooc.xdc
│ │ │ └── MIPS_CPU_clk_wiz_0_0.xdc
│ │ ├── MIPS_CPU_ooc.xdc
│ │ └── hdl
│ │ └── MIPS_CPU_wrapper.v
└── IPCORE
│ ├── ALU
│ └── ALU.srcs
│ │ ├── xgui
│ │ └── ALU32_v1_0.tcl
│ │ ├── sources_1
│ │ └── new
│ │ │ ├── LOGIC.v
│ │ │ ├── SHIFT.v
│ │ │ ├── ALU.v
│ │ │ └── MATH.v
│ │ └── sim_1
│ │ └── new
│ │ └── ALU_TB.sv
│ ├── REGFILE
│ └── REGFILE.srcs
│ │ ├── xgui
│ │ └── REGFILE_v1_0.tcl
│ │ ├── sources_1
│ │ └── new
│ │ │ └── REGFILE.v
│ │ └── sim_1
│ │ └── new
│ │ └── REGFILE_TB.sv
│ ├── DATAPATH
│ └── DATAPATH.srcs
│ │ └── sources_1
│ │ └── new
│ │ ├── xgui
│ │ └── DATAPATH_v1_0.tcl
│ │ ├── DATAPATH.v
│ │ └── ADDSUB32.v
│ ├── DATA_MEM
│ └── DATA_MEM.srcs
│ │ └── sources_1
│ │ └── new
│ │ ├── xgui
│ │ └── DATA_MEM_v1_0.tcl
│ │ └── DATA_MEM.v
│ ├── SHOW_ON_LED
│ └── SHOW_ON_LED.srcs
│ │ └── sources_1
│ │ └── new
│ │ ├── xgui
│ │ └── SHOW_ON_LED_v1_0.tcl
│ │ └── SHOW_ON_LED.v
│ ├── CONTROL_UNIT
│ └── CONTROL_UNIT.srcs
│ │ ├── sim_1
│ │ └── new
│ │ │ └── CONTROL_UNIT_TB.sv
│ │ └── sources_1
│ │ └── new
│ │ └── CONTROL_UNIT.v
│ └── KEY2INST
│ └── KEY2INST.srcs
│ └── sim_1
│ └── new
│ └── KEY2INST_TB.sv
├── CPU_FOR_SIM
├── CPU_FOR_SIM.srcs
│ ├── sources_1
│ │ └── bd
│ │ │ └── MIPS_CPU
│ │ │ ├── ip
│ │ │ ├── MIPS_CPU_clk_wiz_0_0
│ │ │ │ ├── MIPS_CPU_clk_wiz_0_0_board.xdc
│ │ │ │ ├── MIPS_CPU_clk_wiz_0_0_ooc.xdc
│ │ │ │ ├── MIPS_CPU_clk_wiz_0_0.xdc
│ │ │ │ └── doc
│ │ │ │ │ └── clk_wiz_v5_1_changelog.txt
│ │ │ ├── MIPS_CPU_INST_MEM_0_1
│ │ │ │ ├── sim
│ │ │ │ │ └── MIPS_CPU_INST_MEM_0_1.v
│ │ │ │ ├── synth
│ │ │ │ │ └── MIPS_CPU_INST_MEM_0_1.v
│ │ │ │ ├── MIPS_CPU_INST_MEM_0_1.veo
│ │ │ │ └── MIPS_CPU_INST_MEM_0_1.xci
│ │ │ ├── MIPS_CPU_ALU32_0_1
│ │ │ │ ├── sim
│ │ │ │ │ └── MIPS_CPU_ALU32_0_1.v
│ │ │ │ ├── synth
│ │ │ │ │ └── MIPS_CPU_ALU32_0_1.v
│ │ │ │ ├── MIPS_CPU_ALU32_0_1.xci
│ │ │ │ └── MIPS_CPU_ALU32_0_1.veo
│ │ │ ├── MIPS_CPU_DATA_MEM_0_1
│ │ │ │ ├── sim
│ │ │ │ │ └── MIPS_CPU_DATA_MEM_0_1.v
│ │ │ │ ├── synth
│ │ │ │ │ └── MIPS_CPU_DATA_MEM_0_1.v
│ │ │ │ └── MIPS_CPU_DATA_MEM_0_1.xci
│ │ │ └── MIPS_CPU_REGFILE_0_1
│ │ │ │ ├── sim
│ │ │ │ └── MIPS_CPU_REGFILE_0_1.v
│ │ │ │ ├── MIPS_CPU_REGFILE_0_1.xci
│ │ │ │ └── synth
│ │ │ │ └── MIPS_CPU_REGFILE_0_1.v
│ │ │ ├── MIPS_CPU_ooc.xdc
│ │ │ ├── hdl
│ │ │ └── MIPS_CPU_wrapper.v
│ │ │ └── ui
│ │ │ └── bd_a462dba8.ui
│ └── sim_1
│ │ └── new
│ │ └── MIPS_CPU_TB.sv
└── IPCORE
│ ├── ALU
│ └── ALU.srcs
│ │ ├── xgui
│ │ └── ALU32_v1_0.tcl
│ │ ├── sources_1
│ │ └── new
│ │ │ ├── LOGIC.v
│ │ │ ├── SHIFT.v
│ │ │ ├── ALU.v
│ │ │ └── MATH.v
│ │ └── sim_1
│ │ └── new
│ │ └── ALU_TB.sv
│ ├── REGFILE
│ └── REGFILE.srcs
│ │ ├── xgui
│ │ └── REGFILE_v1_0.tcl
│ │ ├── sources_1
│ │ └── new
│ │ │ └── REGFILE.v
│ │ └── sim_1
│ │ └── new
│ │ └── REGFILE_TB.sv
│ ├── DATAPATH
│ └── DATAPATH.srcs
│ │ └── sources_1
│ │ └── new
│ │ ├── xgui
│ │ └── DATAPATH_v1_0.tcl
│ │ ├── DATAPATH.v
│ │ └── ADDSUB32.v
│ ├── DATA_MEM
│ └── DATA_MEM.srcs
│ │ └── sources_1
│ │ └── new
│ │ ├── xgui
│ │ └── DATA_MEM_v1_0.tcl
│ │ └── DATA_MEM.v
│ ├── INST_MEM
│ └── INST_MEM.srcs
│ │ └── sources_1
│ │ └── new
│ │ ├── xgui
│ │ └── INST_MEM_v1_0.tcl
│ │ └── INST_MEM.v
│ └── CONTROL_UNIT
│ └── CONTROL_UNIT.srcs
│ ├── sim_1
│ └── new
│ │ └── CONTROL_UNIT_TB.sv
│ └── sources_1
│ └── new
│ └── CONTROL_UNIT.v
├── SUB_MODULE
├── ALU
│ └── ALU.srcs
│ │ ├── xgui
│ │ └── ALU32_v1_0.tcl
│ │ ├── sources_1
│ │ └── new
│ │ │ ├── LOGIC.v
│ │ │ ├── SHIFT.v
│ │ │ ├── ALU.v
│ │ │ └── MATH.v
│ │ └── sim_1
│ │ └── new
│ │ └── ALU_TB.sv
├── REGFILE
│ ├── REGFILE.srcs
│ │ ├── xgui
│ │ │ └── REGFILE_v1_0.tcl
│ │ ├── sources_1
│ │ │ └── new
│ │ │ │ └── REGFILE.v
│ │ └── sim_1
│ │ │ └── new
│ │ │ └── REGFILE_TB.sv
│ └── REGFILE.xpr
├── DATAPATH
│ └── DATAPATH.srcs
│ │ └── sources_1
│ │ └── new
│ │ ├── xgui
│ │ └── DATAPATH_v1_0.tcl
│ │ ├── DATAPATH.v
│ │ └── ADDSUB32.v
├── DATA_MEM
│ ├── DATA_MEM.srcs
│ │ └── sources_1
│ │ │ └── new
│ │ │ ├── xgui
│ │ │ └── DATA_MEM_v1_0.tcl
│ │ │ └── DATA_MEM.v
│ └── DATA_MEM.xpr
├── INST_MEM
│ ├── INST_MEM.srcs
│ │ └── sources_1
│ │ │ └── new
│ │ │ ├── xgui
│ │ │ └── INST_MEM_v1_0.tcl
│ │ │ └── INST_MEM.v
│ └── INST_MEM.xpr
├── SHOW_ON_LED
│ ├── SHOW_ON_LED.srcs
│ │ └── sources_1
│ │ │ └── new
│ │ │ ├── xgui
│ │ │ └── SHOW_ON_LED_v1_0.tcl
│ │ │ └── SHOW_ON_LED.v
│ └── SHOW_ON_LED.xpr
├── CONTROL_UNIT
│ └── CONTROL_UNIT.srcs
│ │ ├── sim_1
│ │ └── new
│ │ │ └── CONTROL_UNIT_TB.sv
│ │ └── sources_1
│ │ └── new
│ │ └── CONTROL_UNIT.v
└── KEY2INST
│ └── KEY2INST.srcs
│ └── sim_1
│ └── new
│ └── KEY2INST_TB.sv
├── ProjectTcl
├── IPCatalog
│ ├── ALU
│ │ └── ALU.srcs
│ │ │ ├── xgui
│ │ │ └── ALU32_v1_0.tcl
│ │ │ ├── sources_1
│ │ │ └── new
│ │ │ │ ├── LOGIC.v
│ │ │ │ ├── SHIFT.v
│ │ │ │ ├── ALU.v
│ │ │ │ └── MATH.v
│ │ │ └── sim_1
│ │ │ └── new
│ │ │ └── ALU_TB.sv
│ ├── REGFILE
│ │ └── REGFILE.srcs
│ │ │ ├── xgui
│ │ │ └── REGFILE_v1_0.tcl
│ │ │ ├── sources_1
│ │ │ └── new
│ │ │ │ └── REGFILE.v
│ │ │ └── sim_1
│ │ │ └── new
│ │ │ └── REGFILE_TB.sv
│ ├── DATAPATH
│ │ └── DATAPATH.srcs
│ │ │ └── sources_1
│ │ │ └── new
│ │ │ ├── xgui
│ │ │ └── DATAPATH_v1_0.tcl
│ │ │ ├── DATAPATH.v
│ │ │ └── ADDSUB32.v
│ ├── DATA_MEM
│ │ └── DATA_MEM.srcs
│ │ │ └── sources_1
│ │ │ └── new
│ │ │ ├── xgui
│ │ │ └── DATA_MEM_v1_0.tcl
│ │ │ └── DATA_MEM.v
│ ├── INST_MEM
│ │ └── INST_MEM.srcs
│ │ │ └── sources_1
│ │ │ └── new
│ │ │ ├── xgui
│ │ │ └── INST_MEM_v1_0.tcl
│ │ │ └── INST_MEM.v
│ ├── SHOW_ON_LED
│ │ └── SHOW_ON_LED.srcs
│ │ │ └── sources_1
│ │ │ └── new
│ │ │ ├── xgui
│ │ │ └── SHOW_ON_LED_v1_0.tcl
│ │ │ └── SHOW_ON_LED.v
│ ├── CONTROL_UNIT
│ │ └── CONTROL_UNIT.srcs
│ │ │ ├── sim_1
│ │ │ └── new
│ │ │ │ └── CONTROL_UNIT_TB.sv
│ │ │ └── sources_1
│ │ │ └── new
│ │ │ └── CONTROL_UNIT.v
│ └── KEY2INST
│ │ └── KEY2INST.srcs
│ │ └── sim_1
│ │ └── new
│ │ └── KEY2INST_TB.sv
└── Sim
│ └── MIPS_CPU_TB.sv
├── LICENSE
└── README.md
/Image/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/Image/1.png
--------------------------------------------------------------------------------
/Image/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/Image/2.png
--------------------------------------------------------------------------------
/Image/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/Image/3.png
--------------------------------------------------------------------------------
/Image/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/Image/4.png
--------------------------------------------------------------------------------
/Image/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/Image/5.jpg
--------------------------------------------------------------------------------
/Image/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/Image/6.jpg
--------------------------------------------------------------------------------
/Image/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/Image/7.jpg
--------------------------------------------------------------------------------
/XUP/Image/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/XUP/Image/2.png
--------------------------------------------------------------------------------
/XUP/Image/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/XUP/Image/3.png
--------------------------------------------------------------------------------
/XUP/Image/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/XUP/Image/5.jpg
--------------------------------------------------------------------------------
/XUP/Image/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/XUP/Image/6.jpg
--------------------------------------------------------------------------------
/XUP/Image/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/XUP/Image/7.jpg
--------------------------------------------------------------------------------
/CPU_ON_BOARD/procedure.vsdx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/CPU_ON_BOARD/procedure.vsdx
--------------------------------------------------------------------------------
/CPU_ON_BOARD/buttons_function.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dtysky/SIMPLE_MIPS_CPU/HEAD/CPU_ON_BOARD/buttons_function.xlsx
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_clk_wiz_0_0/MIPS_CPU_clk_wiz_0_0_board.xdc:
--------------------------------------------------------------------------------
1 | #--------------------Physical Constraints-----------------
2 |
3 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/CPU_ON_BOARD.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_clk_wiz_0_0/MIPS_CPU_clk_wiz_0_0_board.xdc:
--------------------------------------------------------------------------------
1 | #--------------------Physical Constraints-----------------
2 |
3 |
--------------------------------------------------------------------------------
/SUB_MODULE/ALU/ALU.srcs/xgui/ALU32_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/ALU/ALU.srcs/xgui/ALU32_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/ALU/ALU.srcs/xgui/ALU32_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/ALU/ALU.srcs/xgui/ALU32_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/SUB_MODULE/REGFILE/REGFILE.srcs/xgui/REGFILE_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/REGFILE/REGFILE.srcs/xgui/REGFILE_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/REGFILE/REGFILE.srcs/xgui/REGFILE_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/REGFILE/REGFILE.srcs/xgui/REGFILE_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/SUB_MODULE/DATAPATH/DATAPATH.srcs/sources_1/new/xgui/DATAPATH_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/SUB_MODULE/DATA_MEM/DATA_MEM.srcs/sources_1/new/xgui/DATA_MEM_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/SUB_MODULE/INST_MEM/INST_MEM.srcs/sources_1/new/xgui/INST_MEM_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/DATAPATH/DATAPATH.srcs/sources_1/new/xgui/DATAPATH_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/DATA_MEM/DATA_MEM.srcs/sources_1/new/xgui/DATA_MEM_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/INST_MEM/INST_MEM.srcs/sources_1/new/xgui/INST_MEM_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/DATAPATH/DATAPATH.srcs/sources_1/new/xgui/DATAPATH_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/DATA_MEM/DATA_MEM.srcs/sources_1/new/xgui/DATA_MEM_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/DATAPATH/DATAPATH.srcs/sources_1/new/xgui/DATAPATH_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/DATA_MEM/DATA_MEM.srcs/sources_1/new/xgui/DATA_MEM_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/INST_MEM/INST_MEM.srcs/sources_1/new/xgui/INST_MEM_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/SUB_MODULE/SHOW_ON_LED/SHOW_ON_LED.srcs/sources_1/new/xgui/SHOW_ON_LED_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/SHOW_ON_LED/SHOW_ON_LED.srcs/sources_1/new/xgui/SHOW_ON_LED_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/SHOW_ON_LED/SHOW_ON_LED.srcs/sources_1/new/xgui/SHOW_ON_LED_v1_0.tcl:
--------------------------------------------------------------------------------
1 | # Definitional proc to organize widgets for parameters.
2 | proc init_gui { IPINST } {
3 | set Page0 [ipgui::add_page $IPINST -name "Page 0" -layout vertical]
4 | set Component_Name [ipgui::add_param $IPINST -parent $Page0 -name Component_Name]
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/MIPS_CPU_ooc.xdc:
--------------------------------------------------------------------------------
1 | ################################################################################
2 |
3 | # This XDC is used only for OOC mode of synthesis, implementation
4 | # This constraints file contains default clock frequencies to be used during
5 | # out-of-context flows such as OOC Synthesis and Hierarchical Designs.
6 | # This constraints file is not used in normal top-down synthesis (default flow
7 | # of Vivado)
8 | ################################################################################
9 | #create_clock -name clock_name -period 10 [get_ports clock_name]
10 | ################################################################################
11 |
12 | ################################################################################
--------------------------------------------------------------------------------
/CPU_ON_BOARD/CPU_ON_BOARD.srcs/sources_1/bd/MIPS_CPU/MIPS_CPU_ooc.xdc:
--------------------------------------------------------------------------------
1 | ################################################################################
2 |
3 | # This XDC is used only for OOC mode of synthesis, implementation
4 | # This constraints file contains default clock frequencies to be used during
5 | # out-of-context flows such as OOC Synthesis and Hierarchical Designs.
6 | # This constraints file is not used in normal top-down synthesis (default flow
7 | # of Vivado)
8 | ################################################################################
9 | #create_clock -name clock_name -period 10 [get_ports clock_name]
10 | ################################################################################
11 |
12 | ################################################################################
--------------------------------------------------------------------------------
/SUB_MODULE/ALU/ALU.srcs/sources_1/new/LOGIC.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: LOGIC32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module LOGIC32(
25 | input[31:0] a,b,
26 | input cmd,
27 | output[31:0] r_a,r_b
28 | );
29 |
30 | //AND
31 | //OR
32 | assign r_a = cmd ? a|b : a&b;
33 |
34 | //XOR
35 | //LUI
36 | assign r_b = cmd ? b<<16 : a^b;
37 |
38 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/ALU/ALU.srcs/sources_1/new/LOGIC.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: LOGIC32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module LOGIC32(
25 | input[31:0] a,b,
26 | input cmd,
27 | output[31:0] r_a,r_b
28 | );
29 |
30 | //AND
31 | //OR
32 | assign r_a = cmd ? a|b : a&b;
33 |
34 | //XOR
35 | //LUI
36 | assign r_b = cmd ? b<<16 : a^b;
37 |
38 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/ALU/ALU.srcs/sources_1/new/LOGIC.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: LOGIC32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module LOGIC32(
25 | input[31:0] a,b,
26 | input cmd,
27 | output[31:0] r_a,r_b
28 | );
29 |
30 | //AND
31 | //OR
32 | assign r_a = cmd ? a|b : a&b;
33 |
34 | //XOR
35 | //LUI
36 | assign r_b = cmd ? b<<16 : a^b;
37 |
38 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/ALU/ALU.srcs/sources_1/new/LOGIC.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: LOGIC32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module LOGIC32(
25 | input[31:0] a,b,
26 | input cmd,
27 | output[31:0] r_a,r_b
28 | );
29 |
30 | //AND
31 | //OR
32 | assign r_a = cmd ? a|b : a&b;
33 |
34 | //XOR
35 | //LUI
36 | assign r_b = cmd ? b<<16 : a^b;
37 |
38 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/CPU_ON_BOARD.srcs/sources_1/bd/MIPS_CPU/hdl/MIPS_CPU_wrapper.v:
--------------------------------------------------------------------------------
1 | //Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
2 | //--------------------------------------------------------------------------------
3 | //Tool Version: Vivado v.2014.2 (win64) Build 928826 Thu Jun 5 18:21:07 MDT 2014
4 | //Date : Mon Jan 26 13:25:28 2015
5 | //Host : Dtysky running 64-bit major release (build 9200)
6 | //Command : generate_target MIPS_CPU_wrapper.bd
7 | //Design : MIPS_CPU_wrapper
8 | //Purpose : IP block netlist
9 | //--------------------------------------------------------------------------------
10 | `timescale 1 ps / 1 ps
11 |
12 | module MIPS_CPU_wrapper
13 | (inclk,
14 | key,
15 | led);
16 | input inclk;
17 | input [15:0]key;
18 | output [15:0]led;
19 |
20 | wire inclk;
21 | wire [15:0]key;
22 | wire [15:0]led;
23 |
24 | MIPS_CPU MIPS_CPU_i
25 | (.inclk(inclk),
26 | .key(key),
27 | .led(led));
28 | endmodule
29 |
--------------------------------------------------------------------------------
/SUB_MODULE/SHOW_ON_LED/SHOW_ON_LED.srcs/sources_1/new/SHOW_ON_LED.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: SHOW_ON_LED
8 | // Module Name: SHOW_ON_LED
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module SHOW_ON_LED(
24 | input clk,
25 | input[5:0] inst_op,
26 | input[31:0] alu_r,
27 | input[15:0] button,
28 | output[15:0] led
29 | );
30 |
31 | wire run;
32 | reg[15:0] alu_result;
33 |
34 | assign run = button[14];
35 | assign led = run ? alu_result : button;
36 |
37 | always @(posedge clk)
38 | alu_result <= (inst_op==6'b0 && run==1'b1) ? alu_r[15:0] : alu_result;
39 | endmodule
--------------------------------------------------------------------------------
/SUB_MODULE/ALU/ALU.srcs/sources_1/new/SHIFT.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: ALU32
8 | // Module Name: SHIFT32
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module SHIFT32(
24 | input[4:0] sa,
25 | input signed [31:0] d,
26 | input right,arith,
27 | output[31:0] sh
28 | );
29 |
30 | reg[31:0] r_sh;
31 |
32 | always @(*) begin
33 | case ({right,arith})
34 | 2'b00 :
35 | r_sh <= d << sa;
36 | 2'b10 :
37 | r_sh <= d >> sa;
38 | 2'b01 :
39 | r_sh <= d <<< sa;
40 | 2'b11 :
41 | r_sh <= d >>> sa;
42 | endcase
43 | end
44 |
45 | assign sh = r_sh;
46 |
47 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/ALU/ALU.srcs/sources_1/new/SHIFT.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: ALU32
8 | // Module Name: SHIFT32
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module SHIFT32(
24 | input[4:0] sa,
25 | input signed [31:0] d,
26 | input right,arith,
27 | output[31:0] sh
28 | );
29 |
30 | reg[31:0] r_sh;
31 |
32 | always @(*) begin
33 | case ({right,arith})
34 | 2'b00 :
35 | r_sh <= d << sa;
36 | 2'b10 :
37 | r_sh <= d >> sa;
38 | 2'b01 :
39 | r_sh <= d <<< sa;
40 | 2'b11 :
41 | r_sh <= d >>> sa;
42 | endcase
43 | end
44 |
45 | assign sh = r_sh;
46 |
47 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/ALU/ALU.srcs/sources_1/new/SHIFT.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: ALU32
8 | // Module Name: SHIFT32
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module SHIFT32(
24 | input[4:0] sa,
25 | input signed [31:0] d,
26 | input right,arith,
27 | output[31:0] sh
28 | );
29 |
30 | reg[31:0] r_sh;
31 |
32 | always @(*) begin
33 | case ({right,arith})
34 | 2'b00 :
35 | r_sh <= d << sa;
36 | 2'b10 :
37 | r_sh <= d >> sa;
38 | 2'b01 :
39 | r_sh <= d <<< sa;
40 | 2'b11 :
41 | r_sh <= d >>> sa;
42 | endcase
43 | end
44 |
45 | assign sh = r_sh;
46 |
47 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/SHOW_ON_LED/SHOW_ON_LED.srcs/sources_1/new/SHOW_ON_LED.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: SHOW_ON_LED
8 | // Module Name: SHOW_ON_LED
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module SHOW_ON_LED(
24 | input clk,
25 | input[5:0] inst_op,
26 | input[31:0] alu_r,
27 | input[15:0] button,
28 | output[15:0] led
29 | );
30 |
31 | wire run;
32 | reg[15:0] alu_result;
33 |
34 | assign run = button[14];
35 | assign led = run ? alu_result : button;
36 |
37 | always @(posedge clk)
38 | alu_result <= (inst_op==6'b0 && run==1'b1) ? alu_r[15:0] : alu_result;
39 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/SHOW_ON_LED/SHOW_ON_LED.srcs/sources_1/new/SHOW_ON_LED.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: SHOW_ON_LED
8 | // Module Name: SHOW_ON_LED
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module SHOW_ON_LED(
24 | input clk,
25 | input[5:0] inst_op,
26 | input[31:0] alu_r,
27 | input[15:0] button,
28 | output[15:0] led
29 | );
30 |
31 | wire run;
32 | reg[15:0] alu_result;
33 |
34 | assign run = button[14];
35 | assign led = run ? alu_result : button;
36 |
37 | always @(posedge clk)
38 | alu_result <= (inst_op==6'b0 && run==1'b1) ? alu_r[15:0] : alu_result;
39 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/ALU/ALU.srcs/sources_1/new/SHIFT.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: ALU32
8 | // Module Name: SHIFT32
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module SHIFT32(
24 | input[4:0] sa,
25 | input signed [31:0] d,
26 | input right,arith,
27 | output[31:0] sh
28 | );
29 |
30 | reg[31:0] r_sh;
31 |
32 | always @(*) begin
33 | case ({right,arith})
34 | 2'b00 :
35 | r_sh <= d << sa;
36 | 2'b10 :
37 | r_sh <= d >> sa;
38 | 2'b01 :
39 | r_sh <= d <<< sa;
40 | 2'b11 :
41 | r_sh <= d >>> sa;
42 | endcase
43 | end
44 |
45 | assign sh = r_sh;
46 |
47 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/Sim/MIPS_CPU_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company:
4 | // Engineer:
5 | //
6 | // Create Date: 2015/01/19 12:18:42
7 | // Design Name:
8 | // Module Name: MIPS_CPU_TB
9 | // Project Name:
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(10ns) begin
26 | clk = ~clk;
27 | end
28 | endmodule
29 |
30 | module MIPS_CPU_TB();
31 |
32 | bit clk,reset;
33 | bit[31:0] alu_outpin,data_outpin,inst_outpin,pc_outpin;
34 |
35 | CLOCK CLOCK1(clk);
36 | MIPS_CPU_wrapper MIPS_CPU_wrapper1(alu_outpin,clk,data_outpin,inst_outpin,pc_outpin, reset);
37 |
38 | initial begin
39 | reset = 1'b0;
40 | repeat(100) @(posedge clk);
41 | reset = 1'b1;
42 | repeat(1000) @(posedge clk);
43 | reset = 1'b0;
44 | $finish;
45 | end
46 |
47 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sim_1/new/MIPS_CPU_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company:
4 | // Engineer:
5 | //
6 | // Create Date: 2015/01/19 12:18:42
7 | // Design Name:
8 | // Module Name: MIPS_CPU_TB
9 | // Project Name:
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(10ns) begin
26 | clk = ~clk;
27 | end
28 | endmodule
29 |
30 | module MIPS_CPU_TB();
31 |
32 | bit clk,reset;
33 | bit[31:0] alu_outpin,data_outpin,inst_outpin,pc_outpin;
34 |
35 | CLOCK CLOCK1(clk);
36 | MIPS_CPU_wrapper MIPS_CPU_wrapper1(alu_outpin,clk,data_outpin,inst_outpin,pc_outpin, reset);
37 |
38 | initial begin
39 | reset = 1'b0;
40 | repeat(100) @(posedge clk);
41 | reset = 1'b1;
42 | repeat(1000) @(posedge clk);
43 | reset = 1'b0;
44 | end
45 |
46 | endmodule
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 dtysky
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/SUB_MODULE/DATA_MEM/DATA_MEM.srcs/sources_1/new/DATA_MEM.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/19 10:15:06
7 | // Design Name: DATA_MEM
8 | // Module Name: DATA_MEM
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATA_MEM(
24 | input[31:0] addr,data_in,
25 | input clk,we,
26 | output[31:0] data_out
27 | );
28 |
29 | reg[31:0] ram[0:31];
30 |
31 | always @(posedge clk) begin
32 | if(we) ram[addr[6:2]] <= data_in;
33 | end
34 |
35 | assign data_out = ram[addr[6:2]];
36 |
37 | integer i;
38 | initial begin
39 | for (i=0;i<32;i=i+1)
40 | ram[i] = 32'b0;
41 | ram[5'h14] = 32'h000000a3;
42 | ram[5'h15] = 32'h00000027;
43 | ram[5'h16] = 32'h00000079;
44 | ram[5'h17] = 32'h00000115;
45 | end
46 |
47 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/DATA_MEM/DATA_MEM.srcs/sources_1/new/DATA_MEM.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/19 10:15:06
7 | // Design Name: DATA_MEM
8 | // Module Name: DATA_MEM
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATA_MEM(
24 | input[31:0] addr,data_in,
25 | input clk,we,
26 | output[31:0] data_out
27 | );
28 |
29 | reg[31:0] ram[0:31];
30 |
31 | always @(posedge clk) begin
32 | if(we) ram[addr[6:2]] <= data_in;
33 | end
34 |
35 | assign data_out = ram[addr[6:2]];
36 |
37 | integer i;
38 | initial begin
39 | for (i=0;i<32;i=i+1)
40 | ram[i] = 32'b0;
41 | ram[5'h14] = 32'h000000a3;
42 | ram[5'h15] = 32'h00000027;
43 | ram[5'h16] = 32'h00000079;
44 | ram[5'h17] = 32'h00000115;
45 | end
46 |
47 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/DATA_MEM/DATA_MEM.srcs/sources_1/new/DATA_MEM.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/19 10:15:06
7 | // Design Name: DATA_MEM
8 | // Module Name: DATA_MEM
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATA_MEM(
24 | input[31:0] addr,data_in,
25 | input clk,we,
26 | output[31:0] data_out
27 | );
28 |
29 | reg[31:0] ram[0:31];
30 |
31 | always @(posedge clk) begin
32 | if(we) ram[addr[6:2]] <= data_in;
33 | end
34 |
35 | assign data_out = ram[addr[6:2]];
36 |
37 | integer i;
38 | initial begin
39 | for (i=0;i<32;i=i+1)
40 | ram[i] = 32'b0;
41 | ram[5'h14] = 32'h000000a3;
42 | ram[5'h15] = 32'h00000027;
43 | ram[5'h16] = 32'h00000079;
44 | ram[5'h17] = 32'h00000115;
45 | end
46 |
47 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/DATA_MEM/DATA_MEM.srcs/sources_1/new/DATA_MEM.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/19 10:15:06
7 | // Design Name: DATA_MEM
8 | // Module Name: DATA_MEM
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATA_MEM(
24 | input[31:0] addr,data_in,
25 | input clk,we,
26 | output[31:0] data_out
27 | );
28 |
29 | reg[31:0] ram[0:31];
30 |
31 | always @(posedge clk) begin
32 | if(we) ram[addr[6:2]] <= data_in;
33 | end
34 |
35 | assign data_out = ram[addr[6:2]];
36 |
37 | integer i;
38 | initial begin
39 | for (i=0;i<32;i=i+1)
40 | ram[i] = 32'b0;
41 | ram[5'h14] = 32'h000000a3;
42 | ram[5'h15] = 32'h00000027;
43 | ram[5'h16] = 32'h00000079;
44 | ram[5'h17] = 32'h00000115;
45 | end
46 |
47 | endmodule
--------------------------------------------------------------------------------
/SUB_MODULE/REGFILE/REGFILE.srcs/sources_1/new/REGFILE.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/17 19:33:58
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module REGFILE(
24 | input clk,clrn,
25 | input[31:0] d,
26 | input we,
27 | input[4:0] wn,rna,rnb,
28 | output[31:0] qa,qb
29 | );
30 |
31 | reg[31:0] reg32[31:0];
32 |
33 | integer i;
34 | initial begin
35 | for (i=1;i<=31;i=i+1)
36 | reg32[i] = 32'b0;
37 | end
38 |
39 | always @(posedge clk or negedge clrn) begin
40 | if(~clrn) begin
41 | for (i=0;i<=31;i=i+1)
42 | reg32[i] <= 32'b0;
43 | end else if (we && wn) begin
44 | reg32[wn] <= d;
45 | end
46 | end
47 |
48 | assign qa = reg32[rna];
49 | assign qb = reg32[rnb];
50 |
51 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/REGFILE/REGFILE.srcs/sources_1/new/REGFILE.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/17 19:33:58
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module REGFILE(
24 | input clk,clrn,
25 | input[31:0] d,
26 | input we,
27 | input[4:0] wn,rna,rnb,
28 | output[31:0] qa,qb
29 | );
30 |
31 | reg[31:0] reg32[31:0];
32 |
33 | integer i;
34 | initial begin
35 | for (i=1;i<=31;i=i+1)
36 | reg32[i] = 32'b0;
37 | end
38 |
39 | always @(posedge clk or negedge clrn) begin
40 | if(~clrn) begin
41 | for (i=0;i<=31;i=i+1)
42 | reg32[i] <= 32'b0;
43 | end else if (we && wn) begin
44 | reg32[wn] <= d;
45 | end
46 | end
47 |
48 | assign qa = reg32[rna];
49 | assign qb = reg32[rnb];
50 |
51 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/REGFILE/REGFILE.srcs/sources_1/new/REGFILE.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/17 19:33:58
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module REGFILE(
24 | input clk,clrn,
25 | input[31:0] d,
26 | input we,
27 | input[4:0] wn,rna,rnb,
28 | output[31:0] qa,qb
29 | );
30 |
31 | reg[31:0] reg32[31:0];
32 |
33 | integer i;
34 | initial begin
35 | for (i=1;i<=31;i=i+1)
36 | reg32[i] = 32'b0;
37 | end
38 |
39 | always @(posedge clk or negedge clrn) begin
40 | if(~clrn) begin
41 | for (i=0;i<=31;i=i+1)
42 | reg32[i] <= 32'b0;
43 | end else if (we && wn) begin
44 | reg32[wn] <= d;
45 | end
46 | end
47 |
48 | assign qa = reg32[rna];
49 | assign qb = reg32[rnb];
50 |
51 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/REGFILE/REGFILE.srcs/sources_1/new/REGFILE.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/17 19:33:58
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module REGFILE(
24 | input clk,clrn,
25 | input[31:0] d,
26 | input we,
27 | input[4:0] wn,rna,rnb,
28 | output[31:0] qa,qb
29 | );
30 |
31 | reg[31:0] reg32[31:0];
32 |
33 | integer i;
34 | initial begin
35 | for (i=1;i<=31;i=i+1)
36 | reg32[i] = 32'b0;
37 | end
38 |
39 | always @(posedge clk or negedge clrn) begin
40 | if(~clrn) begin
41 | for (i=0;i<=31;i=i+1)
42 | reg32[i] <= 32'b0;
43 | end else if (we && wn) begin
44 | reg32[wn] <= d;
45 | end
46 | end
47 |
48 | assign qa = reg32[rna];
49 | assign qb = reg32[rnb];
50 |
51 | endmodule
--------------------------------------------------------------------------------
/SUB_MODULE/ALU/ALU.srcs/sources_1/new/ALU.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: ALU32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module ALU32(
25 | input[31:0] a,b,aluc,
26 | output[31:0] r,
27 | output z
28 | );
29 |
30 | reg[31:0] r_r;
31 | wire[31:0] r_shift,r_logic_andor,r_logic_xorlui,r_addsub;
32 |
33 |
34 | SHIFT32 SHITF0 (a[4:0],b,aluc[2],aluc[3],r_shift);
35 | LOGIC32 LOGIC0 (a,b,aluc[2],r_logic_andor,r_logic_xorlui);
36 | ADDSUB32 ADDSUB0 (a,b,aluc[2],r_addsub);
37 |
38 | always @(*) begin
39 | case(aluc[1:0])
40 | 2'b00: r_r <= r_addsub;
41 | 2'b01: r_r <= r_logic_andor;
42 | 2'b10: r_r <= r_logic_xorlui;
43 | 2'b11: r_r <= r_shift;
44 | endcase
45 | end
46 |
47 | assign z = r_r==0 ? 1 : 0;
48 | assign r = r_r;
49 |
50 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/ALU/ALU.srcs/sources_1/new/ALU.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: ALU32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module ALU32(
25 | input[31:0] a,b,aluc,
26 | output[31:0] r,
27 | output z
28 | );
29 |
30 | reg[31:0] r_r;
31 | wire[31:0] r_shift,r_logic_andor,r_logic_xorlui,r_addsub;
32 |
33 |
34 | SHIFT32 SHITF0 (a[4:0],b,aluc[2],aluc[3],r_shift);
35 | LOGIC32 LOGIC0 (a,b,aluc[2],r_logic_andor,r_logic_xorlui);
36 | ADDSUB32 ADDSUB0 (a,b,aluc[2],r_addsub);
37 |
38 | always @(*) begin
39 | case(aluc[1:0])
40 | 2'b00: r_r <= r_addsub;
41 | 2'b01: r_r <= r_logic_andor;
42 | 2'b10: r_r <= r_logic_xorlui;
43 | 2'b11: r_r <= r_shift;
44 | endcase
45 | end
46 |
47 | assign z = r_r==0 ? 1 : 0;
48 | assign r = r_r;
49 |
50 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/ALU/ALU.srcs/sources_1/new/ALU.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: ALU32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module ALU32(
25 | input[31:0] a,b,aluc,
26 | output[31:0] r,
27 | output z
28 | );
29 |
30 | reg[31:0] r_r;
31 | wire[31:0] r_shift,r_logic_andor,r_logic_xorlui,r_addsub;
32 |
33 |
34 | SHIFT32 SHITF0 (a[4:0],b,aluc[2],aluc[3],r_shift);
35 | LOGIC32 LOGIC0 (a,b,aluc[2],r_logic_andor,r_logic_xorlui);
36 | ADDSUB32 ADDSUB0 (a,b,aluc[2],r_addsub);
37 |
38 | always @(*) begin
39 | case(aluc[1:0])
40 | 2'b00: r_r <= r_addsub;
41 | 2'b01: r_r <= r_logic_andor;
42 | 2'b10: r_r <= r_logic_xorlui;
43 | 2'b11: r_r <= r_shift;
44 | endcase
45 | end
46 |
47 | assign z = r_r==0 ? 1 : 0;
48 | assign r = r_r;
49 |
50 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/ALU/ALU.srcs/sources_1/new/ALU.v:
--------------------------------------------------------------------------------
1 | //Author : dtysky
2 | `timescale 1ns / 1ps
3 | //////////////////////////////////////////////////////////////////////////////////
4 | // Company: Xilinx
5 | // Engineer: dtysky
6 | //
7 | // Create Date: 2015/01/16 18:34:13
8 | // Design Name: ALU32
9 | // Module Name: ALU32
10 | // Project Name: MIPS_CPU
11 | // Target Devices:
12 | // Tool Versions:
13 | // Description:
14 | //
15 | // Dependencies:
16 | //
17 | // Revision:
18 | // Revision 0.01 - File Created
19 | // Additional Comments:
20 | //
21 | //////////////////////////////////////////////////////////////////////////////////
22 |
23 |
24 | module ALU32(
25 | input[31:0] a,b,aluc,
26 | output[31:0] r,
27 | output z
28 | );
29 |
30 | reg[31:0] r_r;
31 | wire[31:0] r_shift,r_logic_andor,r_logic_xorlui,r_addsub;
32 |
33 |
34 | SHIFT32 SHITF0 (a[4:0],b,aluc[2],aluc[3],r_shift);
35 | LOGIC32 LOGIC0 (a,b,aluc[2],r_logic_andor,r_logic_xorlui);
36 | ADDSUB32 ADDSUB0 (a,b,aluc[2],r_addsub);
37 |
38 | always @(*) begin
39 | case(aluc[1:0])
40 | 2'b00: r_r <= r_addsub;
41 | 2'b01: r_r <= r_logic_andor;
42 | 2'b10: r_r <= r_logic_xorlui;
43 | 2'b11: r_r <= r_shift;
44 | endcase
45 | end
46 |
47 | assign z = r_r==0 ? 1 : 0;
48 | assign r = r_r;
49 |
50 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/hdl/MIPS_CPU_wrapper.v:
--------------------------------------------------------------------------------
1 | //Copyright 1986-2014 Xilinx, Inc. All Rights Reserved.
2 | //--------------------------------------------------------------------------------
3 | //Tool Version: Vivado v.2014.2 (win64) Build 928826 Thu Jun 5 18:21:07 MDT 2014
4 | //Date : Tue Jan 27 10:02:38 2015
5 | //Host : Dtysky running 64-bit major release (build 9200)
6 | //Command : generate_target MIPS_CPU_wrapper.bd
7 | //Design : MIPS_CPU_wrapper
8 | //Purpose : IP block netlist
9 | //--------------------------------------------------------------------------------
10 | `timescale 1 ps / 1 ps
11 |
12 | module MIPS_CPU_wrapper
13 | (alu_pinout,
14 | clk,
15 | data_pinout,
16 | inst_pinout,
17 | pc_pinout,
18 | restet);
19 | output [31:0]alu_pinout;
20 | input clk;
21 | output [31:0]data_pinout;
22 | output [31:0]inst_pinout;
23 | output [31:0]pc_pinout;
24 | input restet;
25 |
26 | wire [31:0]alu_pinout;
27 | wire clk;
28 | wire [31:0]data_pinout;
29 | wire [31:0]inst_pinout;
30 | wire [31:0]pc_pinout;
31 | wire restet;
32 |
33 | MIPS_CPU MIPS_CPU_i
34 | (.alu_pinout(alu_pinout),
35 | .clk(clk),
36 | .data_pinout(data_pinout),
37 | .inst_pinout(inst_pinout),
38 | .pc_pinout(pc_pinout),
39 | .restet(restet));
40 | endmodule
41 |
--------------------------------------------------------------------------------
/SUB_MODULE/INST_MEM/INST_MEM.srcs/sources_1/new/INST_MEM.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/19 09:26:57
7 | // Design Name: INST_MEM
8 | // Module Name: INST_MEM
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module INST_MEM(
24 | input[31:0] a,
25 | output[31:0] inst_out );
26 |
27 | wire[31:0] rom[0:31];
28 |
29 | assign rom[5'h0] = 32'h3c010000;
30 | assign rom[5'h1] = 32'h34240050;
31 | assign rom[5'h2] = 32'h20050004;
32 | assign rom[5'h3] = 32'h0c000018;
33 | assign rom[5'h4] = 32'hac820000;
34 | assign rom[5'h5] = 32'h8c890000;
35 | assign rom[5'h6] = 32'h01244022;
36 | assign rom[5'h7] = 32'h20050003;
37 | assign rom[5'h8] = 32'h20a5ffff;
38 | assign rom[5'h9] = 32'h34a8ffff;
39 | assign rom[5'ha] = 32'h39085555;
40 | assign rom[5'hb] = 32'h2009ffff;
41 | assign rom[5'hc] = 32'h3124ffff;
42 | assign rom[5'hd] = 32'h01493025;
43 | assign rom[5'he] = 32'h01494026;
44 | assign rom[5'hf] = 32'h01463824;
45 | assign rom[5'h10] = 32'h10a00001;
46 | assign rom[5'h11] = 32'h08000008;
47 | assign rom[5'h12] = 32'h2005ffff;
48 | assign rom[5'h13] = 32'h000543c0;
49 | assign rom[5'h14] = 32'h00084400;
50 | assign rom[5'h15] = 32'h00084403;
51 | assign rom[5'h16] = 32'h000843c2;
52 | assign rom[5'h17] = 32'h08000017;
53 | assign rom[5'h18] = 32'h00004020;
54 | assign rom[5'h19] = 32'h8c890000;
55 | assign rom[5'h1a] = 32'h20840004;
56 | assign rom[5'h1b] = 32'h01094020;
57 | assign rom[5'h1c] = 32'h20a5ffff;
58 | assign rom[5'h1d] = 32'h14a0fffb;
59 | assign rom[5'h1e] = 32'h00081000;
60 | assign rom[5'h1f] = 32'h03e00008;
61 |
62 | assign inst_out = rom[a[6:2]];
63 |
64 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/INST_MEM/INST_MEM.srcs/sources_1/new/INST_MEM.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/19 09:26:57
7 | // Design Name: INST_MEM
8 | // Module Name: INST_MEM
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module INST_MEM(
24 | input[31:0] a,
25 | output[31:0] inst_out );
26 |
27 | wire[31:0] rom[0:31];
28 |
29 | assign rom[5'h0] = 32'h3c010000;
30 | assign rom[5'h1] = 32'h34240050;
31 | assign rom[5'h2] = 32'h20050004;
32 | assign rom[5'h3] = 32'h0c000018;
33 | assign rom[5'h4] = 32'hac820000;
34 | assign rom[5'h5] = 32'h8c890000;
35 | assign rom[5'h6] = 32'h01244022;
36 | assign rom[5'h7] = 32'h20050003;
37 | assign rom[5'h8] = 32'h20a5ffff;
38 | assign rom[5'h9] = 32'h34a8ffff;
39 | assign rom[5'ha] = 32'h39085555;
40 | assign rom[5'hb] = 32'h2009ffff;
41 | assign rom[5'hc] = 32'h3124ffff;
42 | assign rom[5'hd] = 32'h01493025;
43 | assign rom[5'he] = 32'h01494026;
44 | assign rom[5'hf] = 32'h01463824;
45 | assign rom[5'h10] = 32'h10a00001;
46 | assign rom[5'h11] = 32'h08000008;
47 | assign rom[5'h12] = 32'h2005ffff;
48 | assign rom[5'h13] = 32'h000543c0;
49 | assign rom[5'h14] = 32'h00084400;
50 | assign rom[5'h15] = 32'h00084403;
51 | assign rom[5'h16] = 32'h000843c2;
52 | assign rom[5'h17] = 32'h08000017;
53 | assign rom[5'h18] = 32'h00004020;
54 | assign rom[5'h19] = 32'h8c890000;
55 | assign rom[5'h1a] = 32'h20840004;
56 | assign rom[5'h1b] = 32'h01094020;
57 | assign rom[5'h1c] = 32'h20a5ffff;
58 | assign rom[5'h1d] = 32'h14a0fffb;
59 | assign rom[5'h1e] = 32'h00081000;
60 | assign rom[5'h1f] = 32'h03e00008;
61 |
62 | assign inst_out = rom[a[6:2]];
63 |
64 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/INST_MEM/INST_MEM.srcs/sources_1/new/INST_MEM.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/19 09:26:57
7 | // Design Name: INST_MEM
8 | // Module Name: INST_MEM
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module INST_MEM(
24 | input[31:0] a,
25 | output[31:0] inst_out );
26 |
27 | wire[31:0] rom[0:31];
28 |
29 | assign rom[5'h0] = 32'h3c010000;
30 | assign rom[5'h1] = 32'h34240050;
31 | assign rom[5'h2] = 32'h20050004;
32 | assign rom[5'h3] = 32'h0c000018;
33 | assign rom[5'h4] = 32'hac820000;
34 | assign rom[5'h5] = 32'h8c890000;
35 | assign rom[5'h6] = 32'h01244022;
36 | assign rom[5'h7] = 32'h20050003;
37 | assign rom[5'h8] = 32'h20a5ffff;
38 | assign rom[5'h9] = 32'h34a8ffff;
39 | assign rom[5'ha] = 32'h39085555;
40 | assign rom[5'hb] = 32'h2009ffff;
41 | assign rom[5'hc] = 32'h3124ffff;
42 | assign rom[5'hd] = 32'h01493025;
43 | assign rom[5'he] = 32'h01494026;
44 | assign rom[5'hf] = 32'h01463824;
45 | assign rom[5'h10] = 32'h10a00001;
46 | assign rom[5'h11] = 32'h08000008;
47 | assign rom[5'h12] = 32'h2005ffff;
48 | assign rom[5'h13] = 32'h000543c0;
49 | assign rom[5'h14] = 32'h00084400;
50 | assign rom[5'h15] = 32'h00084403;
51 | assign rom[5'h16] = 32'h000843c2;
52 | assign rom[5'h17] = 32'h08000017;
53 | assign rom[5'h18] = 32'h00004020;
54 | assign rom[5'h19] = 32'h8c890000;
55 | assign rom[5'h1a] = 32'h20840004;
56 | assign rom[5'h1b] = 32'h01094020;
57 | assign rom[5'h1c] = 32'h20a5ffff;
58 | assign rom[5'h1d] = 32'h14a0fffb;
59 | assign rom[5'h1e] = 32'h00081000;
60 | assign rom[5'h1f] = 32'h03e00008;
61 |
62 | assign inst_out = rom[a[6:2]];
63 |
64 | endmodule
--------------------------------------------------------------------------------
/SUB_MODULE/CONTROL_UNIT/CONTROL_UNIT.srcs/sim_1/new/CONTROL_UNIT_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:09:04
7 | // Design Name: CONTROL_UNIT
8 | // Module Name: CONTROL_UNIT_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 |
32 | module CONTROL_UNIT_TB();
33 |
34 | class data_creat;
35 | rand bit[5:0] op,func;
36 | rand bit z;
37 |
38 | function void next();
39 | this.randomize();
40 | endfunction : next
41 | endclass : data_creat
42 |
43 | bit clk;
44 | bit[5:0] op,func;
45 | bit z;
46 | bit wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem;
47 | bit[3:0] aluc;
48 | bit[1:0] pcsource;
49 |
50 | data_creat dc;
51 |
52 | CLOCK CLOCK1(clk);
53 | CONTROL_UNIT C1(op,func,z,wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem,aluc,pcsource);
54 |
55 | task req_1();
56 | @(posedge clk);
57 | dc.next();
58 | op = dc.op;
59 | func = dc.func;
60 | z = dc.z;
61 | endtask : req_1
62 |
63 | task req_2();
64 | @(posedge clk);
65 | dc.next();
66 | op = 6'b000000;
67 | func = dc.func;
68 | z = dc.z;
69 | endtask : req_2
70 |
71 | task check();
72 | @(negedge clk);
73 | $display("op = %b\nfunc = %b\nz = %b",op,func,z);
74 | $display("wreg = %b\nregrt = %b\njal = %b\nm2reg = %b\nshfit = %b\naluimm = %b\nsext = %b\nwmem = %b",
75 | wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem);
76 | $display("aluc = %b\npcsource = %b\n",aluc,pcsource);
77 | endtask : check
78 |
79 | initial begin
80 | dc=new();
81 | repeat(100) begin
82 | req_1();
83 | check();
84 | end
85 | repeat(100) begin
86 | req_2();
87 | check();
88 | end
89 | end
90 |
91 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/CONTROL_UNIT/CONTROL_UNIT.srcs/sim_1/new/CONTROL_UNIT_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:09:04
7 | // Design Name: CONTROL_UNIT
8 | // Module Name: CONTROL_UNIT_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 |
32 | module CONTROL_UNIT_TB();
33 |
34 | class data_creat;
35 | rand bit[5:0] op,func;
36 | rand bit z;
37 |
38 | function void next();
39 | this.randomize();
40 | endfunction : next
41 | endclass : data_creat
42 |
43 | bit clk;
44 | bit[5:0] op,func;
45 | bit z;
46 | bit wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem;
47 | bit[3:0] aluc;
48 | bit[1:0] pcsource;
49 |
50 | data_creat dc;
51 |
52 | CLOCK CLOCK1(clk);
53 | CONTROL_UNIT C1(op,func,z,wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem,aluc,pcsource);
54 |
55 | task req_1();
56 | @(posedge clk);
57 | dc.next();
58 | op = dc.op;
59 | func = dc.func;
60 | z = dc.z;
61 | endtask : req_1
62 |
63 | task req_2();
64 | @(posedge clk);
65 | dc.next();
66 | op = 6'b000000;
67 | func = dc.func;
68 | z = dc.z;
69 | endtask : req_2
70 |
71 | task check();
72 | @(negedge clk);
73 | $display("op = %b\nfunc = %b\nz = %b",op,func,z);
74 | $display("wreg = %b\nregrt = %b\njal = %b\nm2reg = %b\nshfit = %b\naluimm = %b\nsext = %b\nwmem = %b",
75 | wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem);
76 | $display("aluc = %b\npcsource = %b\n",aluc,pcsource);
77 | endtask : check
78 |
79 | initial begin
80 | dc=new();
81 | repeat(100) begin
82 | req_1();
83 | check();
84 | end
85 | repeat(100) begin
86 | req_2();
87 | check();
88 | end
89 | end
90 |
91 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/CONTROL_UNIT/CONTROL_UNIT.srcs/sim_1/new/CONTROL_UNIT_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:09:04
7 | // Design Name: CONTROL_UNIT
8 | // Module Name: CONTROL_UNIT_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 |
32 | module CONTROL_UNIT_TB();
33 |
34 | class data_creat;
35 | rand bit[5:0] op,func;
36 | rand bit z;
37 |
38 | function void next();
39 | this.randomize();
40 | endfunction : next
41 | endclass : data_creat
42 |
43 | bit clk;
44 | bit[5:0] op,func;
45 | bit z;
46 | bit wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem;
47 | bit[3:0] aluc;
48 | bit[1:0] pcsource;
49 |
50 | data_creat dc;
51 |
52 | CLOCK CLOCK1(clk);
53 | CONTROL_UNIT C1(op,func,z,wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem,aluc,pcsource);
54 |
55 | task req_1();
56 | @(posedge clk);
57 | dc.next();
58 | op = dc.op;
59 | func = dc.func;
60 | z = dc.z;
61 | endtask : req_1
62 |
63 | task req_2();
64 | @(posedge clk);
65 | dc.next();
66 | op = 6'b000000;
67 | func = dc.func;
68 | z = dc.z;
69 | endtask : req_2
70 |
71 | task check();
72 | @(negedge clk);
73 | $display("op = %b\nfunc = %b\nz = %b",op,func,z);
74 | $display("wreg = %b\nregrt = %b\njal = %b\nm2reg = %b\nshfit = %b\naluimm = %b\nsext = %b\nwmem = %b",
75 | wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem);
76 | $display("aluc = %b\npcsource = %b\n",aluc,pcsource);
77 | endtask : check
78 |
79 | initial begin
80 | dc=new();
81 | repeat(100) begin
82 | req_1();
83 | check();
84 | end
85 | repeat(100) begin
86 | req_2();
87 | check();
88 | end
89 | end
90 |
91 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/CONTROL_UNIT/CONTROL_UNIT.srcs/sim_1/new/CONTROL_UNIT_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:09:04
7 | // Design Name: CONTROL_UNIT
8 | // Module Name: CONTROL_UNIT_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 |
32 | module CONTROL_UNIT_TB();
33 |
34 | class data_creat;
35 | rand bit[5:0] op,func;
36 | rand bit z;
37 |
38 | function void next();
39 | this.randomize();
40 | endfunction : next
41 | endclass : data_creat
42 |
43 | bit clk;
44 | bit[5:0] op,func;
45 | bit z;
46 | bit wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem;
47 | bit[3:0] aluc;
48 | bit[1:0] pcsource;
49 |
50 | data_creat dc;
51 |
52 | CLOCK CLOCK1(clk);
53 | CONTROL_UNIT C1(op,func,z,wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem,aluc,pcsource);
54 |
55 | task req_1();
56 | @(posedge clk);
57 | dc.next();
58 | op = dc.op;
59 | func = dc.func;
60 | z = dc.z;
61 | endtask : req_1
62 |
63 | task req_2();
64 | @(posedge clk);
65 | dc.next();
66 | op = 6'b000000;
67 | func = dc.func;
68 | z = dc.z;
69 | endtask : req_2
70 |
71 | task check();
72 | @(negedge clk);
73 | $display("op = %b\nfunc = %b\nz = %b",op,func,z);
74 | $display("wreg = %b\nregrt = %b\njal = %b\nm2reg = %b\nshfit = %b\naluimm = %b\nsext = %b\nwmem = %b",
75 | wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem);
76 | $display("aluc = %b\npcsource = %b\n",aluc,pcsource);
77 | endtask : check
78 |
79 | initial begin
80 | dc=new();
81 | repeat(100) begin
82 | req_1();
83 | check();
84 | end
85 | repeat(100) begin
86 | req_2();
87 | check();
88 | end
89 | end
90 |
91 | endmodule
--------------------------------------------------------------------------------
/SUB_MODULE/REGFILE/REGFILE.srcs/sim_1/new/REGFILE_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 12:59:16
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 | module REGFILE_TB();
32 |
33 | class data_creat;
34 | bit clrn;
35 | rand bit we;
36 | rand bit[4:0] wn,rna,rnb;
37 | rand bit[31:0] d;
38 |
39 | function new();
40 | clrn=1'b1;
41 | endfunction : new
42 |
43 | function void next();
44 | this.randomize();
45 | endfunction : next
46 |
47 | function void clear();
48 | clrn=1'b0;
49 | endfunction : clear
50 |
51 | endclass : data_creat
52 |
53 | bit clk,clrn;
54 | bit we;
55 | bit[4:0] wn,rna,rnb;
56 | bit[31:0] d,qa,qb;
57 |
58 | data_creat dc;
59 | CLOCK CLOCK1(clk);
60 | REGFILE REGFILE1(clk,clrn,d,we,wn,rna,rnb,qa,qb);
61 |
62 | task showreg32();
63 | @(posedge clk);
64 | rna=4'b0;
65 | $display("clrn = %b",clrn);
66 | for (int i=0;i<32;i=i+1) begin
67 | @(posedge clk);
68 | @(posedge clk);
69 | $display("reg32[%d] = %b",rna,qa);
70 | rna=rna+1;
71 | end
72 | $display("\n");
73 | endtask : showreg32
74 |
75 | task work();
76 | @(posedge clk);
77 | dc.next();
78 | clrn=dc.clrn;
79 | we<=dc.we;
80 | wn=dc.wn;
81 | rna=dc.rna;
82 | rnb=dc.rnb;
83 | d=dc.d;
84 | @(posedge clk);
85 | @(posedge clk);
86 | $display("we = %b\nwn = %d\nd = %b\nrna = %d\nrnb = %d\nqa = %b\nqb = %b",we,wn,d,rna,rnb,qa,qb);
87 | showreg32();
88 | endtask : work
89 |
90 | task clear();
91 | dc.clear();
92 | clrn=dc.clrn;
93 | showreg32();
94 | endtask : clear
95 |
96 | initial begin
97 | dc=new();
98 | repeat(50)
99 | work();
100 | clear();
101 | end
102 |
103 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/REGFILE/REGFILE.srcs/sim_1/new/REGFILE_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 12:59:16
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 | module REGFILE_TB();
32 |
33 | class data_creat;
34 | bit clrn;
35 | rand bit we;
36 | rand bit[4:0] wn,rna,rnb;
37 | rand bit[31:0] d;
38 |
39 | function new();
40 | clrn=1'b1;
41 | endfunction : new
42 |
43 | function void next();
44 | this.randomize();
45 | endfunction : next
46 |
47 | function void clear();
48 | clrn=1'b0;
49 | endfunction : clear
50 |
51 | endclass : data_creat
52 |
53 | bit clk,clrn;
54 | bit we;
55 | bit[4:0] wn,rna,rnb;
56 | bit[31:0] d,qa,qb;
57 |
58 | data_creat dc;
59 | CLOCK CLOCK1(clk);
60 | REGFILE REGFILE1(clk,clrn,d,we,wn,rna,rnb,qa,qb);
61 |
62 | task showreg32();
63 | @(posedge clk);
64 | rna=4'b0;
65 | $display("clrn = %b",clrn);
66 | for (int i=0;i<32;i=i+1) begin
67 | @(posedge clk);
68 | @(posedge clk);
69 | $display("reg32[%d] = %b",rna,qa);
70 | rna=rna+1;
71 | end
72 | $display("\n");
73 | endtask : showreg32
74 |
75 | task work();
76 | @(posedge clk);
77 | dc.next();
78 | clrn=dc.clrn;
79 | we<=dc.we;
80 | wn=dc.wn;
81 | rna=dc.rna;
82 | rnb=dc.rnb;
83 | d=dc.d;
84 | @(posedge clk);
85 | @(posedge clk);
86 | $display("we = %b\nwn = %d\nd = %b\nrna = %d\nrnb = %d\nqa = %b\nqb = %b",we,wn,d,rna,rnb,qa,qb);
87 | showreg32();
88 | endtask : work
89 |
90 | task clear();
91 | dc.clear();
92 | clrn=dc.clrn;
93 | showreg32();
94 | endtask : clear
95 |
96 | initial begin
97 | dc=new();
98 | repeat(50)
99 | work();
100 | clear();
101 | end
102 |
103 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/REGFILE/REGFILE.srcs/sim_1/new/REGFILE_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 12:59:16
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 | module REGFILE_TB();
32 |
33 | class data_creat;
34 | bit clrn;
35 | rand bit we;
36 | rand bit[4:0] wn,rna,rnb;
37 | rand bit[31:0] d;
38 |
39 | function new();
40 | clrn=1'b1;
41 | endfunction : new
42 |
43 | function void next();
44 | this.randomize();
45 | endfunction : next
46 |
47 | function void clear();
48 | clrn=1'b0;
49 | endfunction : clear
50 |
51 | endclass : data_creat
52 |
53 | bit clk,clrn;
54 | bit we;
55 | bit[4:0] wn,rna,rnb;
56 | bit[31:0] d,qa,qb;
57 |
58 | data_creat dc;
59 | CLOCK CLOCK1(clk);
60 | REGFILE REGFILE1(clk,clrn,d,we,wn,rna,rnb,qa,qb);
61 |
62 | task showreg32();
63 | @(posedge clk);
64 | rna=4'b0;
65 | $display("clrn = %b",clrn);
66 | for (int i=0;i<32;i=i+1) begin
67 | @(posedge clk);
68 | @(posedge clk);
69 | $display("reg32[%d] = %b",rna,qa);
70 | rna=rna+1;
71 | end
72 | $display("\n");
73 | endtask : showreg32
74 |
75 | task work();
76 | @(posedge clk);
77 | dc.next();
78 | clrn=dc.clrn;
79 | we<=dc.we;
80 | wn=dc.wn;
81 | rna=dc.rna;
82 | rnb=dc.rnb;
83 | d=dc.d;
84 | @(posedge clk);
85 | @(posedge clk);
86 | $display("we = %b\nwn = %d\nd = %b\nrna = %d\nrnb = %d\nqa = %b\nqb = %b",we,wn,d,rna,rnb,qa,qb);
87 | showreg32();
88 | endtask : work
89 |
90 | task clear();
91 | dc.clear();
92 | clrn=dc.clrn;
93 | showreg32();
94 | endtask : clear
95 |
96 | initial begin
97 | dc=new();
98 | repeat(50)
99 | work();
100 | clear();
101 | end
102 |
103 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/REGFILE/REGFILE.srcs/sim_1/new/REGFILE_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 12:59:16
7 | // Design Name: REGFILE
8 | // Module Name: REGFILE_TB
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 | module REGFILE_TB();
32 |
33 | class data_creat;
34 | bit clrn;
35 | rand bit we;
36 | rand bit[4:0] wn,rna,rnb;
37 | rand bit[31:0] d;
38 |
39 | function new();
40 | clrn=1'b1;
41 | endfunction : new
42 |
43 | function void next();
44 | this.randomize();
45 | endfunction : next
46 |
47 | function void clear();
48 | clrn=1'b0;
49 | endfunction : clear
50 |
51 | endclass : data_creat
52 |
53 | bit clk,clrn;
54 | bit we;
55 | bit[4:0] wn,rna,rnb;
56 | bit[31:0] d,qa,qb;
57 |
58 | data_creat dc;
59 | CLOCK CLOCK1(clk);
60 | REGFILE REGFILE1(clk,clrn,d,we,wn,rna,rnb,qa,qb);
61 |
62 | task showreg32();
63 | @(posedge clk);
64 | rna=4'b0;
65 | $display("clrn = %b",clrn);
66 | for (int i=0;i<32;i=i+1) begin
67 | @(posedge clk);
68 | @(posedge clk);
69 | $display("reg32[%d] = %b",rna,qa);
70 | rna=rna+1;
71 | end
72 | $display("\n");
73 | endtask : showreg32
74 |
75 | task work();
76 | @(posedge clk);
77 | dc.next();
78 | clrn=dc.clrn;
79 | we<=dc.we;
80 | wn=dc.wn;
81 | rna=dc.rna;
82 | rnb=dc.rnb;
83 | d=dc.d;
84 | @(posedge clk);
85 | @(posedge clk);
86 | $display("we = %b\nwn = %d\nd = %b\nrna = %d\nrnb = %d\nqa = %b\nqb = %b",we,wn,d,rna,rnb,qa,qb);
87 | showreg32();
88 | endtask : work
89 |
90 | task clear();
91 | dc.clear();
92 | clrn=dc.clrn;
93 | showreg32();
94 | endtask : clear
95 |
96 | initial begin
97 | dc=new();
98 | repeat(50)
99 | work();
100 | clear();
101 | end
102 |
103 | endmodule
--------------------------------------------------------------------------------
/SUB_MODULE/KEY2INST/KEY2INST.srcs/sim_1/new/KEY2INST_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: KEY2INST
8 | // Module Name: KEY2INST_TB
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 | module KEY2INST_TB();
32 | bit clk,rst_n;
33 | bit run,load;
34 | bit[2:0] cmd;
35 | bit[1:0] select;
36 | bit[7:0] data;
37 | bit[31:0] inst_a,inst_do;
38 | bit[15:0] button;
39 | bit clrn;
40 |
41 | //ah,al,bh,bl
42 | bit[7:0] data_now[3:0];
43 |
44 | CLOCK CLOCK1(clk);
45 | KEY2INST KEY2INST1(clk,button,inst_a,inst_do,clrn);
46 |
47 | function data_creat();
48 | for (int i = 0; i < 4; i++) begin
49 | data_now[i] = $urandom_range(0,8'hff);
50 | end
51 | endfunction : data_creat
52 |
53 | function button_action(bit[1:0] select_now);
54 | button = {rst_n,run,load,cmd,select,data_now[select_now]};
55 | endfunction : button_action
56 |
57 | task data_load(bit[1:0] select_now);
58 | @(posedge clk)
59 | select = select_now;
60 | button_action(select_now);
61 | @(posedge clk)
62 | load = 1'b1;
63 | button_action(select_now);
64 | @(posedge clk)
65 | load = 1'b0;
66 | button_action(select_now);
67 | endtask : data_load
68 |
69 | task check();
70 | $display("cmd = %b",cmd);
71 | $display("data_a = %b",{data_now[0],data_now[1]});
72 | $display("data_b = %b",{data_now[2],data_now[3]});
73 | for (int i = 0; i < 4; i++) begin
74 | @(posedge clk)
75 | inst_a = i <<2;
76 | @(negedge clk)
77 | $display("inst_do[%d] = %b\n",i,inst_do);
78 | end
79 | endtask : check
80 |
81 | initial begin
82 | rst_n = 1'b0;
83 | run = 1'b0;
84 | load = 1'b0;
85 | repeat(10) @(posedge clk);
86 | rst_n = 1'b1;
87 | for (int i = 0; i < 8; i++) begin
88 | data_creat();
89 | for (int j = 0; j < 4; j++) begin
90 | data_load(j);
91 | end
92 | @(posedge clk)
93 | cmd = i;
94 | run = 1'b1;
95 | button_action(0);
96 | @(posedge clk)
97 | run = 1'b0;
98 | check();
99 | end
100 | @(posedge clk)
101 | rst_n = 1'b0;
102 | check();
103 | end
104 |
105 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/KEY2INST/KEY2INST.srcs/sim_1/new/KEY2INST_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: KEY2INST
8 | // Module Name: KEY2INST_TB
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 | module KEY2INST_TB();
32 | bit clk,rst_n;
33 | bit run,load;
34 | bit[2:0] cmd;
35 | bit[1:0] select;
36 | bit[7:0] data;
37 | bit[31:0] inst_a,inst_do;
38 | bit[15:0] button;
39 | bit clrn;
40 |
41 | //ah,al,bh,bl
42 | bit[7:0] data_now[3:0];
43 |
44 | CLOCK CLOCK1(clk);
45 | KEY2INST KEY2INST1(clk,button,inst_a,inst_do,clrn);
46 |
47 | function data_creat();
48 | for (int i = 0; i < 4; i++) begin
49 | data_now[i] = $urandom_range(0,8'hff);
50 | end
51 | endfunction : data_creat
52 |
53 | function button_action(bit[1:0] select_now);
54 | button = {rst_n,run,load,cmd,select,data_now[select_now]};
55 | endfunction : button_action
56 |
57 | task data_load(bit[1:0] select_now);
58 | @(posedge clk)
59 | select = select_now;
60 | button_action(select_now);
61 | @(posedge clk)
62 | load = 1'b1;
63 | button_action(select_now);
64 | @(posedge clk)
65 | load = 1'b0;
66 | button_action(select_now);
67 | endtask : data_load
68 |
69 | task check();
70 | $display("cmd = %b",cmd);
71 | $display("data_a = %b",{data_now[0],data_now[1]});
72 | $display("data_b = %b",{data_now[2],data_now[3]});
73 | for (int i = 0; i < 4; i++) begin
74 | @(posedge clk)
75 | inst_a = i <<2;
76 | @(negedge clk)
77 | $display("inst_do[%d] = %b\n",i,inst_do);
78 | end
79 | endtask : check
80 |
81 | initial begin
82 | rst_n = 1'b0;
83 | run = 1'b0;
84 | load = 1'b0;
85 | repeat(10) @(posedge clk);
86 | rst_n = 1'b1;
87 | for (int i = 0; i < 8; i++) begin
88 | data_creat();
89 | for (int j = 0; j < 4; j++) begin
90 | data_load(j);
91 | end
92 | @(posedge clk)
93 | cmd = i;
94 | run = 1'b1;
95 | button_action(0);
96 | @(posedge clk)
97 | run = 1'b0;
98 | check();
99 | end
100 | @(posedge clk)
101 | rst_n = 1'b0;
102 | check();
103 | end
104 |
105 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/KEY2INST/KEY2INST.srcs/sim_1/new/KEY2INST_TB.sv:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/16 18:34:13
7 | // Design Name: KEY2INST
8 | // Module Name: KEY2INST_TB
9 | // Project Name: MIPS_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CLOCK (
22 | output bit clk
23 | );
24 |
25 | always #(100ps) begin
26 | clk = ~clk;
27 | end
28 |
29 | endmodule
30 |
31 | module KEY2INST_TB();
32 | bit clk,rst_n;
33 | bit run,load;
34 | bit[2:0] cmd;
35 | bit[1:0] select;
36 | bit[7:0] data;
37 | bit[31:0] inst_a,inst_do;
38 | bit[15:0] button;
39 | bit clrn;
40 |
41 | //ah,al,bh,bl
42 | bit[7:0] data_now[3:0];
43 |
44 | CLOCK CLOCK1(clk);
45 | KEY2INST KEY2INST1(clk,button,inst_a,inst_do,clrn);
46 |
47 | function data_creat();
48 | for (int i = 0; i < 4; i++) begin
49 | data_now[i] = $urandom_range(0,8'hff);
50 | end
51 | endfunction : data_creat
52 |
53 | function button_action(bit[1:0] select_now);
54 | button = {rst_n,run,load,cmd,select,data_now[select_now]};
55 | endfunction : button_action
56 |
57 | task data_load(bit[1:0] select_now);
58 | @(posedge clk)
59 | select = select_now;
60 | button_action(select_now);
61 | @(posedge clk)
62 | load = 1'b1;
63 | button_action(select_now);
64 | @(posedge clk)
65 | load = 1'b0;
66 | button_action(select_now);
67 | endtask : data_load
68 |
69 | task check();
70 | $display("cmd = %b",cmd);
71 | $display("data_a = %b",{data_now[0],data_now[1]});
72 | $display("data_b = %b",{data_now[2],data_now[3]});
73 | for (int i = 0; i < 4; i++) begin
74 | @(posedge clk)
75 | inst_a = i <<2;
76 | @(negedge clk)
77 | $display("inst_do[%d] = %b\n",i,inst_do);
78 | end
79 | endtask : check
80 |
81 | initial begin
82 | rst_n = 1'b0;
83 | run = 1'b0;
84 | load = 1'b0;
85 | repeat(10) @(posedge clk);
86 | rst_n = 1'b1;
87 | for (int i = 0; i < 8; i++) begin
88 | data_creat();
89 | for (int j = 0; j < 4; j++) begin
90 | data_load(j);
91 | end
92 | @(posedge clk)
93 | cmd = i;
94 | run = 1'b1;
95 | button_action(0);
96 | @(posedge clk)
97 | run = 1'b0;
98 | check();
99 | end
100 | @(posedge clk)
101 | rst_n = 1'b0;
102 | check();
103 | end
104 |
105 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_clk_wiz_0_0/MIPS_CPU_clk_wiz_0_0_ooc.xdc:
--------------------------------------------------------------------------------
1 | # file: MIPS_CPU_clk_wiz_0_0_ooc.xdc
2 | #
3 | # (c) Copyright 2008 - 2013 Xilinx, Inc. All rights reserved.
4 | #
5 | # This file contains confidential and proprietary information
6 | # of Xilinx, Inc. and is protected under U.S. and
7 | # international copyright and other intellectual property
8 | # laws.
9 | #
10 | # DISCLAIMER
11 | # This disclaimer is not a license and does not grant any
12 | # rights to the materials distributed herewith. Except as
13 | # otherwise provided in a valid license issued to you by
14 | # Xilinx, and to the maximum extent permitted by applicable
15 | # law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
16 | # WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
17 | # AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
18 | # BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
19 | # INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
20 | # (2) Xilinx shall not be liable (whether in contract or tort,
21 | # including negligence, or under any other theory of
22 | # liability) for any loss or damage of any kind or nature
23 | # related to, arising under or in connection with these
24 | # materials, including for any direct, or any indirect,
25 | # special, incidental, or consequential loss or damage
26 | # (including loss of data, profits, goodwill, or any type of
27 | # loss or damage suffered as a result of any action brought
28 | # by a third party) even if such damage or loss was
29 | # reasonably foreseeable or Xilinx had been advised of the
30 | # possibility of the same.
31 | #
32 | # CRITICAL APPLICATIONS
33 | # Xilinx products are not designed or intended to be fail-
34 | # safe, or for use in any application requiring fail-safe
35 | # performance, such as life-support or safety devices or
36 | # systems, Class III medical devices, nuclear facilities,
37 | # applications related to the deployment of airbags, or any
38 | # other applications that could lead to death, personal
39 | # injury, or severe property or environmental damage
40 | # (individually and collectively, "Critical
41 | # Applications"). Customer assumes the sole risk and
42 | # liability of any use of Xilinx products in Critical
43 | # Applications, subject only to applicable laws and
44 | # regulations governing limitations on product liability.
45 | #
46 | # THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
47 | # PART OF THIS FILE AT ALL TIMES.
48 | #
49 |
50 | #################
51 | #DEFAULT CLOCK CONSTRAINTS
52 |
53 | ############################################################
54 | # Clock Period Constraints #
55 | ############################################################
56 | #create_clock -period 10.0 [get_ports clk_in1]
57 |
58 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/CPU_ON_BOARD.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_clk_wiz_0_0/MIPS_CPU_clk_wiz_0_0_ooc.xdc:
--------------------------------------------------------------------------------
1 | # file: MIPS_CPU_clk_wiz_0_0_ooc.xdc
2 | #
3 | # (c) Copyright 2008 - 2013 Xilinx, Inc. All rights reserved.
4 | #
5 | # This file contains confidential and proprietary information
6 | # of Xilinx, Inc. and is protected under U.S. and
7 | # international copyright and other intellectual property
8 | # laws.
9 | #
10 | # DISCLAIMER
11 | # This disclaimer is not a license and does not grant any
12 | # rights to the materials distributed herewith. Except as
13 | # otherwise provided in a valid license issued to you by
14 | # Xilinx, and to the maximum extent permitted by applicable
15 | # law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
16 | # WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
17 | # AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
18 | # BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
19 | # INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
20 | # (2) Xilinx shall not be liable (whether in contract or tort,
21 | # including negligence, or under any other theory of
22 | # liability) for any loss or damage of any kind or nature
23 | # related to, arising under or in connection with these
24 | # materials, including for any direct, or any indirect,
25 | # special, incidental, or consequential loss or damage
26 | # (including loss of data, profits, goodwill, or any type of
27 | # loss or damage suffered as a result of any action brought
28 | # by a third party) even if such damage or loss was
29 | # reasonably foreseeable or Xilinx had been advised of the
30 | # possibility of the same.
31 | #
32 | # CRITICAL APPLICATIONS
33 | # Xilinx products are not designed or intended to be fail-
34 | # safe, or for use in any application requiring fail-safe
35 | # performance, such as life-support or safety devices or
36 | # systems, Class III medical devices, nuclear facilities,
37 | # applications related to the deployment of airbags, or any
38 | # other applications that could lead to death, personal
39 | # injury, or severe property or environmental damage
40 | # (individually and collectively, "Critical
41 | # Applications"). Customer assumes the sole risk and
42 | # liability of any use of Xilinx products in Critical
43 | # Applications, subject only to applicable laws and
44 | # regulations governing limitations on product liability.
45 | #
46 | # THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
47 | # PART OF THIS FILE AT ALL TIMES.
48 | #
49 |
50 | #################
51 | #DEFAULT CLOCK CONSTRAINTS
52 |
53 | ############################################################
54 | # Clock Period Constraints #
55 | ############################################################
56 | #create_clock -period 10.0 [get_ports clk_in1]
57 |
58 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_INST_MEM_0_1/sim/MIPS_CPU_INST_MEM_0_1.v:
--------------------------------------------------------------------------------
1 | // (c) Copyright 1995-2015 Xilinx, Inc. All rights reserved.
2 | //
3 | // This file contains confidential and proprietary information
4 | // of Xilinx, Inc. and is protected under U.S. and
5 | // international copyright and other intellectual property
6 | // laws.
7 | //
8 | // DISCLAIMER
9 | // This disclaimer is not a license and does not grant any
10 | // rights to the materials distributed herewith. Except as
11 | // otherwise provided in a valid license issued to you by
12 | // Xilinx, and to the maximum extent permitted by applicable
13 | // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
14 | // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
15 | // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
16 | // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
17 | // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
18 | // (2) Xilinx shall not be liable (whether in contract or tort,
19 | // including negligence, or under any other theory of
20 | // liability) for any loss or damage of any kind or nature
21 | // related to, arising under or in connection with these
22 | // materials, including for any direct, or any indirect,
23 | // special, incidental, or consequential loss or damage
24 | // (including loss of data, profits, goodwill, or any type of
25 | // loss or damage suffered as a result of any action brought
26 | // by a third party) even if such damage or loss was
27 | // reasonably foreseeable or Xilinx had been advised of the
28 | // possibility of the same.
29 | //
30 | // CRITICAL APPLICATIONS
31 | // Xilinx products are not designed or intended to be fail-
32 | // safe, or for use in any application requiring fail-safe
33 | // performance, such as life-support or safety devices or
34 | // systems, Class III medical devices, nuclear facilities,
35 | // applications related to the deployment of airbags, or any
36 | // other applications that could lead to death, personal
37 | // injury, or severe property or environmental damage
38 | // (individually and collectively, "Critical
39 | // Applications"). Customer assumes the sole risk and
40 | // liability of any use of Xilinx products in Critical
41 | // Applications, subject only to applicable laws and
42 | // regulations governing limitations on product liability.
43 | //
44 | // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
45 | // PART OF THIS FILE AT ALL TIMES.
46 | //
47 | // DO NOT MODIFY THIS FILE.
48 |
49 |
50 | // IP VLNV: dtysky:user:INST_MEM:1.1
51 | // IP Revision: 5
52 |
53 | `timescale 1ns/1ps
54 |
55 | (* DowngradeIPIdentifiedWarnings = "yes" *)
56 | module MIPS_CPU_INST_MEM_0_1 (
57 | a,
58 | inst_out
59 | );
60 |
61 | input wire [31 : 0] a;
62 | output wire [31 : 0] inst_out;
63 |
64 | INST_MEM inst (
65 | .a(a),
66 | .inst_out(inst_out)
67 | );
68 | endmodule
69 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_clk_wiz_0_0/MIPS_CPU_clk_wiz_0_0.xdc:
--------------------------------------------------------------------------------
1 | # file: MIPS_CPU_clk_wiz_0_0.xdc
2 | #
3 | # (c) Copyright 2008 - 2013 Xilinx, Inc. All rights reserved.
4 | #
5 | # This file contains confidential and proprietary information
6 | # of Xilinx, Inc. and is protected under U.S. and
7 | # international copyright and other intellectual property
8 | # laws.
9 | #
10 | # DISCLAIMER
11 | # This disclaimer is not a license and does not grant any
12 | # rights to the materials distributed herewith. Except as
13 | # otherwise provided in a valid license issued to you by
14 | # Xilinx, and to the maximum extent permitted by applicable
15 | # law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
16 | # WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
17 | # AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
18 | # BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
19 | # INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
20 | # (2) Xilinx shall not be liable (whether in contract or tort,
21 | # including negligence, or under any other theory of
22 | # liability) for any loss or damage of any kind or nature
23 | # related to, arising under or in connection with these
24 | # materials, including for any direct, or any indirect,
25 | # special, incidental, or consequential loss or damage
26 | # (including loss of data, profits, goodwill, or any type of
27 | # loss or damage suffered as a result of any action brought
28 | # by a third party) even if such damage or loss was
29 | # reasonably foreseeable or Xilinx had been advised of the
30 | # possibility of the same.
31 | #
32 | # CRITICAL APPLICATIONS
33 | # Xilinx products are not designed or intended to be fail-
34 | # safe, or for use in any application requiring fail-safe
35 | # performance, such as life-support or safety devices or
36 | # systems, Class III medical devices, nuclear facilities,
37 | # applications related to the deployment of airbags, or any
38 | # other applications that could lead to death, personal
39 | # injury, or severe property or environmental damage
40 | # (individually and collectively, "Critical
41 | # Applications"). Customer assumes the sole risk and
42 | # liability of any use of Xilinx products in Critical
43 | # Applications, subject only to applicable laws and
44 | # regulations governing limitations on product liability.
45 | #
46 | # THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
47 | # PART OF THIS FILE AT ALL TIMES.
48 | #
49 |
50 | # Input clock periods. These duplicate the values entered for the
51 | # input clocks. You can use these to time your system. If required
52 | # commented constraints can be used in the top level xdc
53 | #----------------------------------------------------------------
54 | # Connect to input port when clock capable pin is selected for input
55 | create_clock -period 10.0 [get_ports clk_in1]
56 | set_input_jitter [get_clocks -of_objects [get_ports clk_in1]] 0.1
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/CPU_ON_BOARD/CPU_ON_BOARD.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_clk_wiz_0_0/MIPS_CPU_clk_wiz_0_0.xdc:
--------------------------------------------------------------------------------
1 | # file: MIPS_CPU_clk_wiz_0_0.xdc
2 | #
3 | # (c) Copyright 2008 - 2013 Xilinx, Inc. All rights reserved.
4 | #
5 | # This file contains confidential and proprietary information
6 | # of Xilinx, Inc. and is protected under U.S. and
7 | # international copyright and other intellectual property
8 | # laws.
9 | #
10 | # DISCLAIMER
11 | # This disclaimer is not a license and does not grant any
12 | # rights to the materials distributed herewith. Except as
13 | # otherwise provided in a valid license issued to you by
14 | # Xilinx, and to the maximum extent permitted by applicable
15 | # law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
16 | # WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
17 | # AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
18 | # BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
19 | # INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
20 | # (2) Xilinx shall not be liable (whether in contract or tort,
21 | # including negligence, or under any other theory of
22 | # liability) for any loss or damage of any kind or nature
23 | # related to, arising under or in connection with these
24 | # materials, including for any direct, or any indirect,
25 | # special, incidental, or consequential loss or damage
26 | # (including loss of data, profits, goodwill, or any type of
27 | # loss or damage suffered as a result of any action brought
28 | # by a third party) even if such damage or loss was
29 | # reasonably foreseeable or Xilinx had been advised of the
30 | # possibility of the same.
31 | #
32 | # CRITICAL APPLICATIONS
33 | # Xilinx products are not designed or intended to be fail-
34 | # safe, or for use in any application requiring fail-safe
35 | # performance, such as life-support or safety devices or
36 | # systems, Class III medical devices, nuclear facilities,
37 | # applications related to the deployment of airbags, or any
38 | # other applications that could lead to death, personal
39 | # injury, or severe property or environmental damage
40 | # (individually and collectively, "Critical
41 | # Applications"). Customer assumes the sole risk and
42 | # liability of any use of Xilinx products in Critical
43 | # Applications, subject only to applicable laws and
44 | # regulations governing limitations on product liability.
45 | #
46 | # THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
47 | # PART OF THIS FILE AT ALL TIMES.
48 | #
49 |
50 | # Input clock periods. These duplicate the values entered for the
51 | # input clocks. You can use these to time your system. If required
52 | # commented constraints can be used in the top level xdc
53 | #----------------------------------------------------------------
54 | # Connect to input port when clock capable pin is selected for input
55 | create_clock -period 10.0 [get_ports clk_in1]
56 | set_input_jitter [get_clocks -of_objects [get_ports clk_in1]] 0.1
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_INST_MEM_0_1/synth/MIPS_CPU_INST_MEM_0_1.v:
--------------------------------------------------------------------------------
1 | // (c) Copyright 1995-2015 Xilinx, Inc. All rights reserved.
2 | //
3 | // This file contains confidential and proprietary information
4 | // of Xilinx, Inc. and is protected under U.S. and
5 | // international copyright and other intellectual property
6 | // laws.
7 | //
8 | // DISCLAIMER
9 | // This disclaimer is not a license and does not grant any
10 | // rights to the materials distributed herewith. Except as
11 | // otherwise provided in a valid license issued to you by
12 | // Xilinx, and to the maximum extent permitted by applicable
13 | // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
14 | // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
15 | // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
16 | // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
17 | // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
18 | // (2) Xilinx shall not be liable (whether in contract or tort,
19 | // including negligence, or under any other theory of
20 | // liability) for any loss or damage of any kind or nature
21 | // related to, arising under or in connection with these
22 | // materials, including for any direct, or any indirect,
23 | // special, incidental, or consequential loss or damage
24 | // (including loss of data, profits, goodwill, or any type of
25 | // loss or damage suffered as a result of any action brought
26 | // by a third party) even if such damage or loss was
27 | // reasonably foreseeable or Xilinx had been advised of the
28 | // possibility of the same.
29 | //
30 | // CRITICAL APPLICATIONS
31 | // Xilinx products are not designed or intended to be fail-
32 | // safe, or for use in any application requiring fail-safe
33 | // performance, such as life-support or safety devices or
34 | // systems, Class III medical devices, nuclear facilities,
35 | // applications related to the deployment of airbags, or any
36 | // other applications that could lead to death, personal
37 | // injury, or severe property or environmental damage
38 | // (individually and collectively, "Critical
39 | // Applications"). Customer assumes the sole risk and
40 | // liability of any use of Xilinx products in Critical
41 | // Applications, subject only to applicable laws and
42 | // regulations governing limitations on product liability.
43 | //
44 | // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
45 | // PART OF THIS FILE AT ALL TIMES.
46 | //
47 | // DO NOT MODIFY THIS FILE.
48 |
49 |
50 | // IP VLNV: dtysky:user:INST_MEM:1.1
51 | // IP Revision: 5
52 |
53 | (* X_CORE_INFO = "INST_MEM,Vivado 2014.2" *)
54 | (* CHECK_LICENSE_TYPE = "MIPS_CPU_INST_MEM_0_1,INST_MEM,{}" *)
55 | (* DowngradeIPIdentifiedWarnings = "yes" *)
56 | module MIPS_CPU_INST_MEM_0_1 (
57 | a,
58 | inst_out
59 | );
60 |
61 | input wire [31 : 0] a;
62 | output wire [31 : 0] inst_out;
63 |
64 | INST_MEM inst (
65 | .a(a),
66 | .inst_out(inst_out)
67 | );
68 | endmodule
69 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_ALU32_0_1/sim/MIPS_CPU_ALU32_0_1.v:
--------------------------------------------------------------------------------
1 | // (c) Copyright 1995-2015 Xilinx, Inc. All rights reserved.
2 | //
3 | // This file contains confidential and proprietary information
4 | // of Xilinx, Inc. and is protected under U.S. and
5 | // international copyright and other intellectual property
6 | // laws.
7 | //
8 | // DISCLAIMER
9 | // This disclaimer is not a license and does not grant any
10 | // rights to the materials distributed herewith. Except as
11 | // otherwise provided in a valid license issued to you by
12 | // Xilinx, and to the maximum extent permitted by applicable
13 | // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
14 | // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
15 | // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
16 | // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
17 | // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
18 | // (2) Xilinx shall not be liable (whether in contract or tort,
19 | // including negligence, or under any other theory of
20 | // liability) for any loss or damage of any kind or nature
21 | // related to, arising under or in connection with these
22 | // materials, including for any direct, or any indirect,
23 | // special, incidental, or consequential loss or damage
24 | // (including loss of data, profits, goodwill, or any type of
25 | // loss or damage suffered as a result of any action brought
26 | // by a third party) even if such damage or loss was
27 | // reasonably foreseeable or Xilinx had been advised of the
28 | // possibility of the same.
29 | //
30 | // CRITICAL APPLICATIONS
31 | // Xilinx products are not designed or intended to be fail-
32 | // safe, or for use in any application requiring fail-safe
33 | // performance, such as life-support or safety devices or
34 | // systems, Class III medical devices, nuclear facilities,
35 | // applications related to the deployment of airbags, or any
36 | // other applications that could lead to death, personal
37 | // injury, or severe property or environmental damage
38 | // (individually and collectively, "Critical
39 | // Applications"). Customer assumes the sole risk and
40 | // liability of any use of Xilinx products in Critical
41 | // Applications, subject only to applicable laws and
42 | // regulations governing limitations on product liability.
43 | //
44 | // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
45 | // PART OF THIS FILE AT ALL TIMES.
46 | //
47 | // DO NOT MODIFY THIS FILE.
48 |
49 |
50 | // IP VLNV: dtysky:user:ALU32:1.0
51 | // IP Revision: 2
52 |
53 | `timescale 1ns/1ps
54 |
55 | (* DowngradeIPIdentifiedWarnings = "yes" *)
56 | module MIPS_CPU_ALU32_0_1 (
57 | a,
58 | b,
59 | aluc,
60 | r,
61 | z
62 | );
63 |
64 | input wire [31 : 0] a;
65 | input wire [31 : 0] b;
66 | input wire [31 : 0] aluc;
67 | output wire [31 : 0] r;
68 | output wire z;
69 |
70 | ALU32 inst (
71 | .a(a),
72 | .b(b),
73 | .aluc(aluc),
74 | .r(r),
75 | .z(z)
76 | );
77 | endmodule
78 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_DATA_MEM_0_1/sim/MIPS_CPU_DATA_MEM_0_1.v:
--------------------------------------------------------------------------------
1 | // (c) Copyright 1995-2015 Xilinx, Inc. All rights reserved.
2 | //
3 | // This file contains confidential and proprietary information
4 | // of Xilinx, Inc. and is protected under U.S. and
5 | // international copyright and other intellectual property
6 | // laws.
7 | //
8 | // DISCLAIMER
9 | // This disclaimer is not a license and does not grant any
10 | // rights to the materials distributed herewith. Except as
11 | // otherwise provided in a valid license issued to you by
12 | // Xilinx, and to the maximum extent permitted by applicable
13 | // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
14 | // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
15 | // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
16 | // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
17 | // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
18 | // (2) Xilinx shall not be liable (whether in contract or tort,
19 | // including negligence, or under any other theory of
20 | // liability) for any loss or damage of any kind or nature
21 | // related to, arising under or in connection with these
22 | // materials, including for any direct, or any indirect,
23 | // special, incidental, or consequential loss or damage
24 | // (including loss of data, profits, goodwill, or any type of
25 | // loss or damage suffered as a result of any action brought
26 | // by a third party) even if such damage or loss was
27 | // reasonably foreseeable or Xilinx had been advised of the
28 | // possibility of the same.
29 | //
30 | // CRITICAL APPLICATIONS
31 | // Xilinx products are not designed or intended to be fail-
32 | // safe, or for use in any application requiring fail-safe
33 | // performance, such as life-support or safety devices or
34 | // systems, Class III medical devices, nuclear facilities,
35 | // applications related to the deployment of airbags, or any
36 | // other applications that could lead to death, personal
37 | // injury, or severe property or environmental damage
38 | // (individually and collectively, "Critical
39 | // Applications"). Customer assumes the sole risk and
40 | // liability of any use of Xilinx products in Critical
41 | // Applications, subject only to applicable laws and
42 | // regulations governing limitations on product liability.
43 | //
44 | // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
45 | // PART OF THIS FILE AT ALL TIMES.
46 | //
47 | // DO NOT MODIFY THIS FILE.
48 |
49 |
50 | // IP VLNV: dtysky:user:DATA_MEM:1.0
51 | // IP Revision: 4
52 |
53 | `timescale 1ns/1ps
54 |
55 | (* DowngradeIPIdentifiedWarnings = "yes" *)
56 | module MIPS_CPU_DATA_MEM_0_1 (
57 | addr,
58 | data_in,
59 | clk,
60 | we,
61 | data_out
62 | );
63 |
64 | input wire [31 : 0] addr;
65 | input wire [31 : 0] data_in;
66 | input wire clk;
67 | input wire we;
68 | output wire [31 : 0] data_out;
69 |
70 | DATA_MEM inst (
71 | .addr(addr),
72 | .data_in(data_in),
73 | .clk(clk),
74 | .we(we),
75 | .data_out(data_out)
76 | );
77 | endmodule
78 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_INST_MEM_0_1/MIPS_CPU_INST_MEM_0_1.veo:
--------------------------------------------------------------------------------
1 | // (c) Copyright 1995-2015 Xilinx, Inc. All rights reserved.
2 | //
3 | // This file contains confidential and proprietary information
4 | // of Xilinx, Inc. and is protected under U.S. and
5 | // international copyright and other intellectual property
6 | // laws.
7 | //
8 | // DISCLAIMER
9 | // This disclaimer is not a license and does not grant any
10 | // rights to the materials distributed herewith. Except as
11 | // otherwise provided in a valid license issued to you by
12 | // Xilinx, and to the maximum extent permitted by applicable
13 | // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
14 | // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
15 | // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
16 | // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
17 | // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
18 | // (2) Xilinx shall not be liable (whether in contract or tort,
19 | // including negligence, or under any other theory of
20 | // liability) for any loss or damage of any kind or nature
21 | // related to, arising under or in connection with these
22 | // materials, including for any direct, or any indirect,
23 | // special, incidental, or consequential loss or damage
24 | // (including loss of data, profits, goodwill, or any type of
25 | // loss or damage suffered as a result of any action brought
26 | // by a third party) even if such damage or loss was
27 | // reasonably foreseeable or Xilinx had been advised of the
28 | // possibility of the same.
29 | //
30 | // CRITICAL APPLICATIONS
31 | // Xilinx products are not designed or intended to be fail-
32 | // safe, or for use in any application requiring fail-safe
33 | // performance, such as life-support or safety devices or
34 | // systems, Class III medical devices, nuclear facilities,
35 | // applications related to the deployment of airbags, or any
36 | // other applications that could lead to death, personal
37 | // injury, or severe property or environmental damage
38 | // (individually and collectively, "Critical
39 | // Applications"). Customer assumes the sole risk and
40 | // liability of any use of Xilinx products in Critical
41 | // Applications, subject only to applicable laws and
42 | // regulations governing limitations on product liability.
43 | //
44 | // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
45 | // PART OF THIS FILE AT ALL TIMES.
46 | //
47 | // DO NOT MODIFY THIS FILE.
48 |
49 | // IP VLNV: dtysky:user:INST_MEM:1.1
50 | // IP Revision: 5
51 |
52 | // The following must be inserted into your Verilog file for this
53 | // core to be instantiated. Change the instance name and port connections
54 | // (in parentheses) to your own signal names.
55 |
56 | //----------- Begin Cut here for INSTANTIATION Template ---// INST_TAG
57 | MIPS_CPU_INST_MEM_0_1 your_instance_name (
58 | .a(a), // input wire [31 : 0] a
59 | .inst_out(inst_out) // output wire [31 : 0] inst_out
60 | );
61 | // INST_TAG_END ------ End INSTANTIATION Template ---------
62 |
63 |
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_ALU32_0_1/synth/MIPS_CPU_ALU32_0_1.v:
--------------------------------------------------------------------------------
1 | // (c) Copyright 1995-2015 Xilinx, Inc. All rights reserved.
2 | //
3 | // This file contains confidential and proprietary information
4 | // of Xilinx, Inc. and is protected under U.S. and
5 | // international copyright and other intellectual property
6 | // laws.
7 | //
8 | // DISCLAIMER
9 | // This disclaimer is not a license and does not grant any
10 | // rights to the materials distributed herewith. Except as
11 | // otherwise provided in a valid license issued to you by
12 | // Xilinx, and to the maximum extent permitted by applicable
13 | // law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
14 | // WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
15 | // AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
16 | // BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
17 | // INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
18 | // (2) Xilinx shall not be liable (whether in contract or tort,
19 | // including negligence, or under any other theory of
20 | // liability) for any loss or damage of any kind or nature
21 | // related to, arising under or in connection with these
22 | // materials, including for any direct, or any indirect,
23 | // special, incidental, or consequential loss or damage
24 | // (including loss of data, profits, goodwill, or any type of
25 | // loss or damage suffered as a result of any action brought
26 | // by a third party) even if such damage or loss was
27 | // reasonably foreseeable or Xilinx had been advised of the
28 | // possibility of the same.
29 | //
30 | // CRITICAL APPLICATIONS
31 | // Xilinx products are not designed or intended to be fail-
32 | // safe, or for use in any application requiring fail-safe
33 | // performance, such as life-support or safety devices or
34 | // systems, Class III medical devices, nuclear facilities,
35 | // applications related to the deployment of airbags, or any
36 | // other applications that could lead to death, personal
37 | // injury, or severe property or environmental damage
38 | // (individually and collectively, "Critical
39 | // Applications"). Customer assumes the sole risk and
40 | // liability of any use of Xilinx products in Critical
41 | // Applications, subject only to applicable laws and
42 | // regulations governing limitations on product liability.
43 | //
44 | // THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
45 | // PART OF THIS FILE AT ALL TIMES.
46 | //
47 | // DO NOT MODIFY THIS FILE.
48 |
49 |
50 | // IP VLNV: dtysky:user:ALU32:1.0
51 | // IP Revision: 2
52 |
53 | (* X_CORE_INFO = "ALU32,Vivado 2014.2" *)
54 | (* CHECK_LICENSE_TYPE = "MIPS_CPU_ALU32_0_1,ALU32,{}" *)
55 | (* DowngradeIPIdentifiedWarnings = "yes" *)
56 | module MIPS_CPU_ALU32_0_1 (
57 | a,
58 | b,
59 | aluc,
60 | r,
61 | z
62 | );
63 |
64 | input wire [31 : 0] a;
65 | input wire [31 : 0] b;
66 | input wire [31 : 0] aluc;
67 | output wire [31 : 0] r;
68 | output wire z;
69 |
70 | ALU32 inst (
71 | .a(a),
72 | .b(b),
73 | .aluc(aluc),
74 | .r(r),
75 | .z(z)
76 | );
77 | endmodule
78 |
--------------------------------------------------------------------------------
/SUB_MODULE/DATAPATH/DATAPATH.srcs/sources_1/new/DATAPATH.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:56:28
7 | // Design Name: DATAPATH
8 | // Module Name: DATAPATH
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATAPATH(
24 | input clk,clrn,
25 | input alu_z,
26 | input[31:0] alu_r,
27 | output[31:0] alu_a,alu_b,
28 | output[31:0] alu_aluc,
29 | output reg_we,
30 | input[31:0] reg_qa,reg_qb,
31 | output[4:0] reg_wn,reg_rna,reg_rnb,
32 | output[31:0] reg_d,
33 | input con_wreg,con_regrt,con_jal,con_m2reg,con_shfit,con_aluimm,con_sext,con_wmem,
34 | input[3:0] con_aluc,
35 | input[1:0] con_pcsource,
36 | output[5:0] con_op,con_func,
37 | output con_z,
38 | input[31:0] inst_do,
39 | output[31:0] inst_a,
40 | input[31:0] data_do,
41 | output[31:0] data_a,data_di,
42 | output data_we,
43 | output[31:0] pc_out
44 | );
45 |
46 | wire[4:0] rs,rt,rd,sa;
47 | wire signed [31:0] imm;
48 | wire[25:0] addr;
49 | reg[31:0] pc_i,pc_o;
50 | wire[31:0] pc_p4,pc_jump;
51 | wire[4:0] reg_dest;
52 | wire[31:0] imm_ext,reg_data_dest;
53 |
54 | initial begin
55 | pc_i = 32'b0;
56 | end
57 |
58 | assign rs = inst_do[25:21];
59 | assign rt = inst_do[20:16];
60 | assign rd = inst_do[15:11];
61 | assign sa = inst_do[10:6];
62 | assign imm = {inst_do[15:0],16'b0};
63 | assign addr = inst_do[25:0];
64 | assign imm_ext = con_sext ? imm>>>16 : imm>>16;
65 |
66 | assign pc_p4 = pc_o + 4;
67 | assign pc_out = pc_o;
68 |
69 | assign reg_dest = con_regrt ? rt : rd;
70 | assign reg_wn = reg_dest | {5{con_jal}};
71 | assign reg_data_dest = con_m2reg ? data_do : alu_r;
72 | assign reg_d = con_jal ? pc_p4 : reg_data_dest;
73 | assign reg_rna = rs;
74 | assign reg_rnb = rt;
75 | assign reg_we = con_wreg;
76 |
77 | assign con_op = inst_do[31:26];
78 | assign con_func = inst_do[5:0];
79 | assign con_z = alu_z;
80 |
81 | assign alu_a = con_shfit ? {27'b0,sa} : reg_qa;
82 | assign alu_b = con_aluimm ? imm_ext : reg_qb;
83 | assign alu_aluc = {28'b0,con_aluc};
84 |
85 | assign data_we = con_wmem;
86 | assign data_di = reg_qb;
87 | assign data_a = alu_r;
88 |
89 | assign inst_a = pc_o;
90 |
91 | always @(posedge clk or negedge clrn) begin
92 | if (~clrn) pc_o <= 32'b0;
93 | else pc_o <= pc_i;
94 | end
95 |
96 | ADDSUB32 ADDSUB1(pc_p4,imm_ext<<2,1'b0,pc_jump);
97 |
98 | always @(*) begin
99 | case (con_pcsource)
100 | 2'b00 : pc_i <= pc_p4;
101 | 2'b01 : pc_i <= pc_jump;
102 | 2'b10 : pc_i <= reg_qa;
103 | 2'b11 : pc_i <= {pc_p4[31:28],addr,2'b0};
104 | default : /* default */;
105 | endcase
106 | end
107 |
108 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/IPCORE/DATAPATH/DATAPATH.srcs/sources_1/new/DATAPATH.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:56:28
7 | // Design Name: DATAPATH
8 | // Module Name: DATAPATH
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATAPATH(
24 | input clk,clrn,
25 | input alu_z,
26 | input[31:0] alu_r,
27 | output[31:0] alu_a,alu_b,
28 | output[31:0] alu_aluc,
29 | output reg_we,
30 | input[31:0] reg_qa,reg_qb,
31 | output[4:0] reg_wn,reg_rna,reg_rnb,
32 | output[31:0] reg_d,
33 | input con_wreg,con_regrt,con_jal,con_m2reg,con_shfit,con_aluimm,con_sext,con_wmem,
34 | input[3:0] con_aluc,
35 | input[1:0] con_pcsource,
36 | output[5:0] con_op,con_func,
37 | output con_z,
38 | input[31:0] inst_do,
39 | output[31:0] inst_a,
40 | input[31:0] data_do,
41 | output[31:0] data_a,data_di,
42 | output data_we,
43 | output[31:0] pc_out
44 | );
45 |
46 | wire[4:0] rs,rt,rd,sa;
47 | wire signed [31:0] imm;
48 | wire[25:0] addr;
49 | reg[31:0] pc_i,pc_o;
50 | wire[31:0] pc_p4,pc_jump;
51 | wire[4:0] reg_dest;
52 | wire[31:0] imm_ext,reg_data_dest;
53 |
54 | initial begin
55 | pc_i = 32'b0;
56 | end
57 |
58 | assign rs = inst_do[25:21];
59 | assign rt = inst_do[20:16];
60 | assign rd = inst_do[15:11];
61 | assign sa = inst_do[10:6];
62 | assign imm = {inst_do[15:0],16'b0};
63 | assign addr = inst_do[25:0];
64 | assign imm_ext = con_sext ? imm>>>16 : imm>>16;
65 |
66 | assign pc_p4 = pc_o + 4;
67 | assign pc_out = pc_o;
68 |
69 | assign reg_dest = con_regrt ? rt : rd;
70 | assign reg_wn = reg_dest | {5{con_jal}};
71 | assign reg_data_dest = con_m2reg ? data_do : alu_r;
72 | assign reg_d = con_jal ? pc_p4 : reg_data_dest;
73 | assign reg_rna = rs;
74 | assign reg_rnb = rt;
75 | assign reg_we = con_wreg;
76 |
77 | assign con_op = inst_do[31:26];
78 | assign con_func = inst_do[5:0];
79 | assign con_z = alu_z;
80 |
81 | assign alu_a = con_shfit ? {27'b0,sa} : reg_qa;
82 | assign alu_b = con_aluimm ? imm_ext : reg_qb;
83 | assign alu_aluc = {28'b0,con_aluc};
84 |
85 | assign data_we = con_wmem;
86 | assign data_di = reg_qb;
87 | assign data_a = alu_r;
88 |
89 | assign inst_a = pc_o;
90 |
91 | always @(posedge clk or negedge clrn) begin
92 | if (~clrn) pc_o <= 32'b0;
93 | else pc_o <= pc_i;
94 | end
95 |
96 | ADDSUB32 ADDSUB1(pc_p4,imm_ext<<2,1'b0,pc_jump);
97 |
98 | always @(*) begin
99 | case (con_pcsource)
100 | 2'b00 : pc_i <= pc_p4;
101 | 2'b01 : pc_i <= pc_jump;
102 | 2'b10 : pc_i <= reg_qa;
103 | 2'b11 : pc_i <= {pc_p4[31:28],addr,2'b0};
104 | default : /* default */;
105 | endcase
106 | end
107 |
108 | endmodule
--------------------------------------------------------------------------------
/CPU_ON_BOARD/IPCORE/DATAPATH/DATAPATH.srcs/sources_1/new/DATAPATH.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:56:28
7 | // Design Name: DATAPATH
8 | // Module Name: DATAPATH
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATAPATH(
24 | input clk,clrn,
25 | input alu_z,
26 | input[31:0] alu_r,
27 | output[31:0] alu_a,alu_b,
28 | output[31:0] alu_aluc,
29 | output reg_we,
30 | input[31:0] reg_qa,reg_qb,
31 | output[4:0] reg_wn,reg_rna,reg_rnb,
32 | output[31:0] reg_d,
33 | input con_wreg,con_regrt,con_jal,con_m2reg,con_shfit,con_aluimm,con_sext,con_wmem,
34 | input[3:0] con_aluc,
35 | input[1:0] con_pcsource,
36 | output[5:0] con_op,con_func,
37 | output con_z,
38 | input[31:0] inst_do,
39 | output[31:0] inst_a,
40 | input[31:0] data_do,
41 | output[31:0] data_a,data_di,
42 | output data_we,
43 | output[31:0] pc_out
44 | );
45 |
46 | wire[4:0] rs,rt,rd,sa;
47 | wire signed [31:0] imm;
48 | wire[25:0] addr;
49 | reg[31:0] pc_i,pc_o;
50 | wire[31:0] pc_p4,pc_jump;
51 | wire[4:0] reg_dest;
52 | wire[31:0] imm_ext,reg_data_dest;
53 |
54 | initial begin
55 | pc_i = 32'b0;
56 | end
57 |
58 | assign rs = inst_do[25:21];
59 | assign rt = inst_do[20:16];
60 | assign rd = inst_do[15:11];
61 | assign sa = inst_do[10:6];
62 | assign imm = {inst_do[15:0],16'b0};
63 | assign addr = inst_do[25:0];
64 | assign imm_ext = con_sext ? imm>>>16 : imm>>16;
65 |
66 | assign pc_p4 = pc_o + 4;
67 | assign pc_out = pc_o;
68 |
69 | assign reg_dest = con_regrt ? rt : rd;
70 | assign reg_wn = reg_dest | {5{con_jal}};
71 | assign reg_data_dest = con_m2reg ? data_do : alu_r;
72 | assign reg_d = con_jal ? pc_p4 : reg_data_dest;
73 | assign reg_rna = rs;
74 | assign reg_rnb = rt;
75 | assign reg_we = con_wreg;
76 |
77 | assign con_op = inst_do[31:26];
78 | assign con_func = inst_do[5:0];
79 | assign con_z = alu_z;
80 |
81 | assign alu_a = con_shfit ? {27'b0,sa} : reg_qa;
82 | assign alu_b = con_aluimm ? imm_ext : reg_qb;
83 | assign alu_aluc = {28'b0,con_aluc};
84 |
85 | assign data_we = con_wmem;
86 | assign data_di = reg_qb;
87 | assign data_a = alu_r;
88 |
89 | assign inst_a = pc_o;
90 |
91 | always @(posedge clk or negedge clrn) begin
92 | if (~clrn) pc_o <= 32'b0;
93 | else pc_o <= pc_i;
94 | end
95 |
96 | ADDSUB32 ADDSUB1(pc_p4,imm_ext<<2,1'b0,pc_jump);
97 |
98 | always @(*) begin
99 | case (con_pcsource)
100 | 2'b00 : pc_i <= pc_p4;
101 | 2'b01 : pc_i <= pc_jump;
102 | 2'b10 : pc_i <= reg_qa;
103 | 2'b11 : pc_i <= {pc_p4[31:28],addr,2'b0};
104 | default : /* default */;
105 | endcase
106 | end
107 |
108 | endmodule
--------------------------------------------------------------------------------
/ProjectTcl/IPCatalog/DATAPATH/DATAPATH.srcs/sources_1/new/DATAPATH.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 16:56:28
7 | // Design Name: DATAPATH
8 | // Module Name: DATAPATH
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 |
22 |
23 | module DATAPATH(
24 | input clk,clrn,
25 | input alu_z,
26 | input[31:0] alu_r,
27 | output[31:0] alu_a,alu_b,
28 | output[31:0] alu_aluc,
29 | output reg_we,
30 | input[31:0] reg_qa,reg_qb,
31 | output[4:0] reg_wn,reg_rna,reg_rnb,
32 | output[31:0] reg_d,
33 | input con_wreg,con_regrt,con_jal,con_m2reg,con_shfit,con_aluimm,con_sext,con_wmem,
34 | input[3:0] con_aluc,
35 | input[1:0] con_pcsource,
36 | output[5:0] con_op,con_func,
37 | output con_z,
38 | input[31:0] inst_do,
39 | output[31:0] inst_a,
40 | input[31:0] data_do,
41 | output[31:0] data_a,data_di,
42 | output data_we,
43 | output[31:0] pc_out
44 | );
45 |
46 | wire[4:0] rs,rt,rd,sa;
47 | wire signed [31:0] imm;
48 | wire[25:0] addr;
49 | reg[31:0] pc_i,pc_o;
50 | wire[31:0] pc_p4,pc_jump;
51 | wire[4:0] reg_dest;
52 | wire[31:0] imm_ext,reg_data_dest;
53 |
54 | initial begin
55 | pc_i = 32'b0;
56 | end
57 |
58 | assign rs = inst_do[25:21];
59 | assign rt = inst_do[20:16];
60 | assign rd = inst_do[15:11];
61 | assign sa = inst_do[10:6];
62 | assign imm = {inst_do[15:0],16'b0};
63 | assign addr = inst_do[25:0];
64 | assign imm_ext = con_sext ? imm>>>16 : imm>>16;
65 |
66 | assign pc_p4 = pc_o + 4;
67 | assign pc_out = pc_o;
68 |
69 | assign reg_dest = con_regrt ? rt : rd;
70 | assign reg_wn = reg_dest | {5{con_jal}};
71 | assign reg_data_dest = con_m2reg ? data_do : alu_r;
72 | assign reg_d = con_jal ? pc_p4 : reg_data_dest;
73 | assign reg_rna = rs;
74 | assign reg_rnb = rt;
75 | assign reg_we = con_wreg;
76 |
77 | assign con_op = inst_do[31:26];
78 | assign con_func = inst_do[5:0];
79 | assign con_z = alu_z;
80 |
81 | assign alu_a = con_shfit ? {27'b0,sa} : reg_qa;
82 | assign alu_b = con_aluimm ? imm_ext : reg_qb;
83 | assign alu_aluc = {28'b0,con_aluc};
84 |
85 | assign data_we = con_wmem;
86 | assign data_di = reg_qb;
87 | assign data_a = alu_r;
88 |
89 | assign inst_a = pc_o;
90 |
91 | always @(posedge clk or negedge clrn) begin
92 | if (~clrn) pc_o <= 32'b0;
93 | else pc_o <= pc_i;
94 | end
95 |
96 | ADDSUB32 ADDSUB1(pc_p4,imm_ext<<2,1'b0,pc_jump);
97 |
98 | always @(*) begin
99 | case (con_pcsource)
100 | 2'b00 : pc_i <= pc_p4;
101 | 2'b01 : pc_i <= pc_jump;
102 | 2'b10 : pc_i <= reg_qa;
103 | 2'b11 : pc_i <= {pc_p4[31:28],addr,2'b0};
104 | default : /* default */;
105 | endcase
106 | end
107 |
108 | endmodule
--------------------------------------------------------------------------------
/SUB_MODULE/CONTROL_UNIT/CONTROL_UNIT.srcs/sources_1/new/CONTROL_UNIT.v:
--------------------------------------------------------------------------------
1 | `timescale 1ns / 1ps
2 | //////////////////////////////////////////////////////////////////////////////////
3 | // Company: Xilinx
4 | // Engineer: dtysky
5 | //
6 | // Create Date: 2015/01/18 15:20:50
7 | // Design Name: CONTROL_UNIT
8 | // Module Name: CONTROL_UNIT
9 | // Project Name: MISP_CPU
10 | // Target Devices:
11 | // Tool Versions:
12 | // Description:
13 | //
14 | // Dependencies:
15 | //
16 | // Revision:
17 | // Revision 0.01 - File Created
18 | // Additional Comments:
19 | //
20 | //////////////////////////////////////////////////////////////////////////////////
21 | module CONTROL_UNIT(
22 | input[5:0] op,func,
23 | input z,
24 | output wreg,regrt,jal,m2reg,shfit,aluimm,sext,wmem,
25 | output[3:0] aluc,
26 | output[1:0] pcsource
27 | );
28 |
29 | parameter cmd_add = 6'b100000;
30 | parameter cmd_sub = 6'b100010;
31 | parameter cmd_and = 6'b100100;
32 | parameter cmd_or = 6'b100101;
33 | parameter cmd_xor = 6'b100110;
34 | parameter cmd_sll = 6'b000000;
35 | parameter cmd_srl = 6'b000010;
36 | parameter cmd_sra = 6'b000011;
37 | parameter cmd_jr = 6'b001000;
38 | parameter cmd_addi = 6'b001000;
39 | parameter cmd_andi = 6'b001100;
40 | parameter cmd_ori = 6'b001101;
41 | parameter cmd_xori = 6'b001110;
42 | parameter cmd_lw = 6'b100011;
43 | parameter cmd_sw = 6'b101011;
44 | parameter cmd_beq = 6'b000100;
45 | parameter cmd_bne = 6'b000101;
46 | parameter cmd_lui = 6'b001111;
47 | parameter cmd_j = 6'b000010;
48 | parameter cmd_jal = 6'b000011;
49 |
50 |
51 | reg[13:0] cmd_out;
52 |
53 | always @(*) begin
54 | case (op)
55 | 6'b0 : begin
56 | case (func)
57 | cmd_add : cmd_out <= 14'b10000000000000;
58 | cmd_sub : cmd_out <= 14'b10000000100000;
59 | cmd_and : cmd_out <= 14'b10000000001000;
60 | cmd_or : cmd_out <= 14'b10000000101000;
61 | cmd_xor : cmd_out <= 14'b10000000010000;
62 | cmd_sll : cmd_out <= 14'b10001000011000;
63 | cmd_srl : cmd_out <= 14'b10001000111000;
64 | cmd_sra : cmd_out <= 14'b10001001111000;
65 | cmd_jr : cmd_out <= 14'b00000000000010;
66 | default : cmd_out <= 14'b00000000000000;
67 | endcase
68 | end
69 | cmd_addi : cmd_out <= 14'b11000110000000;
70 | cmd_andi : cmd_out <= 14'b11000100001000;
71 | cmd_ori : cmd_out <= 14'b11000100101000;
72 | cmd_xori : cmd_out <= 14'b11000100010000;
73 | cmd_lw : cmd_out <= 14'b11010110000000;
74 | cmd_sw : cmd_out <= 14'b00000110000100;
75 | cmd_beq : cmd_out <= {13'b0000001001000,z};
76 | cmd_bne : cmd_out <= {13'b0000001001000,~z};
77 | cmd_lui : cmd_out <= 14'b11000100110000;
78 | cmd_j : cmd_out <= 14'b00000000000011;
79 | cmd_jal : cmd_out <= 14'b10100000000011;
80 | default : cmd_out <= 14'b00000000000000;
81 | endcase
82 | end
83 |
84 | assign wreg = cmd_out[13];
85 | assign regrt = cmd_out[12];
86 | assign jal = cmd_out[11];
87 | assign m2reg = cmd_out[10];
88 | assign shfit = cmd_out[9];
89 | assign aluimm = cmd_out[8];
90 | assign sext = cmd_out[7];
91 | assign aluc = cmd_out[6:3];
92 | assign wmem = cmd_out[2];
93 | assign pcsource = cmd_out[1:0];
94 |
95 | endmodule
--------------------------------------------------------------------------------
/CPU_FOR_SIM/CPU_FOR_SIM.srcs/sources_1/bd/MIPS_CPU/ip/MIPS_CPU_ALU32_0_1/MIPS_CPU_ALU32_0_1.xci:
--------------------------------------------------------------------------------
1 |
2 |