Add Repo: MIPSfpga_mipsfpga-plus
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- MIPSfpga_mipsfpga-plus/.vscode/launch.json +65 -0
- MIPSfpga_mipsfpga-plus/README.md +92 -0
- MIPSfpga_mipsfpga-plus/boards/basys3/basys3.v +136 -0
- MIPSfpga_mipsfpga-plus/boards/basys3/system_create.tcl +246 -0
- MIPSfpga_mipsfpga-plus/boards/basys3/system_load.tcl +21 -0
- MIPSfpga_mipsfpga-plus/boards/basys3/system_synth.tcl +19 -0
- MIPSfpga_mipsfpga-plus/boards/de0/de0.sdc +81 -0
- MIPSfpga_mipsfpga-plus/boards/de0/de0.v +177 -0
- MIPSfpga_mipsfpga-plus/boards/de0_cv/board_config.vh +24 -0
- MIPSfpga_mipsfpga-plus/boards/de0_cv/de0_cv.sdc +83 -0
- MIPSfpga_mipsfpga-plus/boards/de0_cv/de0_cv.v +230 -0
- MIPSfpga_mipsfpga-plus/boards/de0_nano/de0_nano.sdc +87 -0
- MIPSfpga_mipsfpga-plus/boards/de0_nano/de0_nano.v +144 -0
- MIPSfpga_mipsfpga-plus/boards/de1/de1.sdc +61 -0
- MIPSfpga_mipsfpga-plus/boards/de1/de1.v +182 -0
- MIPSfpga_mipsfpga-plus/boards/de10_lite/board_config.vh +24 -0
- MIPSfpga_mipsfpga-plus/boards/de10_lite/de10_lite.sdc +84 -0
- MIPSfpga_mipsfpga-plus/boards/de10_lite/de10_lite.v +306 -0
- MIPSfpga_mipsfpga-plus/boards/de10_lite/pll.v +395 -0
- MIPSfpga_mipsfpga-plus/boards/de10_nano/de10_nano.sdc +92 -0
- MIPSfpga_mipsfpga-plus/boards/de10_nano/de10_nano.v +148 -0
- MIPSfpga_mipsfpga-plus/boards/de2_115/de2_115.sdc +62 -0
- MIPSfpga_mipsfpga-plus/boards/de2_115/de2_115.v +343 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4/nexys4.v +148 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4/system_create.tcl +246 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4/system_load.tcl +21 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4/system_synth.tcl +19 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/nexys4_ddr.v +158 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/system_create.tcl +246 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/system_load.tcl +21 -0
- MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/system_synth.tcl +19 -0
- MIPSfpga_mipsfpga-plus/documentation/figure_generator/generator.cpp +336 -0
- MIPSfpga_mipsfpga-plus/documentation/figure_generator/utilities.cpp +143 -0
- MIPSfpga_mipsfpga-plus/documentation/html_labs_for_blog/convert_html_to_wordpress.c +78 -0
- MIPSfpga_mipsfpga-plus/exercises/module_to_use/hc_sr04_ultrasonic_distance_sensor.v +122 -0
- MIPSfpga_mipsfpga-plus/exercises/module_to_use/m14k_udi_mipsfpga_ai.v +149 -0
- MIPSfpga_mipsfpga-plus/exercises/module_to_use/pmod_als_light_sensor.v +47 -0
- MIPSfpga_mipsfpga-plus/exercises/module_to_use/pmod_enc_rotary_encoder.v +33 -0
- MIPSfpga_mipsfpga-plus/programs/00_counter/main.c +26 -0
- MIPSfpga_mipsfpga-plus/programs/00_counter/mfp_memory_mapped_registers.h +20 -0
- MIPSfpga_mipsfpga-plus/programs/00_counter/modelsim_script.tcl +27 -0
- MIPSfpga_mipsfpga-plus/programs/01_light_sensor/main.c +24 -0
- MIPSfpga_mipsfpga-plus/programs/01_light_sensor/mfp_memory_mapped_registers.h +23 -0
- MIPSfpga_mipsfpga-plus/programs/01_light_sensor/modelsim_script.tcl +27 -0
- MIPSfpga_mipsfpga-plus/programs/02_interrupts/main.c +62 -0
- MIPSfpga_mipsfpga-plus/programs/02_interrupts/mfp_memory_mapped_registers.h +20 -0
- MIPSfpga_mipsfpga-plus/programs/02_interrupts/modelsim_script.tcl +27 -0
- MIPSfpga_mipsfpga-plus/programs/03_cache_misses/main.c +22 -0
- MIPSfpga_mipsfpga-plus/programs/03_cache_misses/mfp_memory_mapped_registers.h +20 -0
- MIPSfpga_mipsfpga-plus/programs/03_cache_misses/modelsim_script.tcl +27 -0
MIPSfpga_mipsfpga-plus/.vscode/launch.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": "0.2.0",
|
| 3 |
+
"configurations": [
|
| 4 |
+
|
| 5 |
+
{
|
| 6 |
+
"name": "MIPS Load",
|
| 7 |
+
"type": "cppdbg",
|
| 8 |
+
"request": "launch",
|
| 9 |
+
"program": "${fileDirname}/program.elf",
|
| 10 |
+
"cwd": "${fileDirname}",
|
| 11 |
+
"MIMode" : "gdb",
|
| 12 |
+
"windows": {
|
| 13 |
+
"miDebuggerPath": "mips-mti-elf-gdb.exe"
|
| 14 |
+
},
|
| 15 |
+
"linux": {
|
| 16 |
+
"miDebuggerPath": "mips-mti-elf-gdb"
|
| 17 |
+
},
|
| 18 |
+
"setupCommands": [
|
| 19 |
+
{"text": "cd ${fileDirname}"},
|
| 20 |
+
{"text": "file program.elf"},
|
| 21 |
+
{"text": "target remote | openocd -f ../../scripts/load/openocd.cfg -p -c 'log_output openocd.log'"},
|
| 22 |
+
{"text": "set endian little"},
|
| 23 |
+
{"text": "monitor reset halt"},
|
| 24 |
+
{"text": "load"},
|
| 25 |
+
{"text": "compare-sections"},
|
| 26 |
+
{"text": "break main"},
|
| 27 |
+
{"text": "monitor continue"}
|
| 28 |
+
],
|
| 29 |
+
"launchCompleteCommand": "None",
|
| 30 |
+
"targetArchitecture": "mips"
|
| 31 |
+
|
| 32 |
+
//Uncomment this to debug
|
| 33 |
+
//,"logging": { "engineLogging": true }
|
| 34 |
+
//or this for verbose debug
|
| 35 |
+
//,"logging": { "engineLogging": true, "trace": true, "traceResponse": true }
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"name": "MIPS Attach",
|
| 39 |
+
"type": "cppdbg",
|
| 40 |
+
"request": "launch",
|
| 41 |
+
"program": "${fileDirname}/program.elf",
|
| 42 |
+
"cwd": "${fileDirname}",
|
| 43 |
+
"windows": {
|
| 44 |
+
"miDebuggerPath": "mips-mti-elf-gdb.exe"
|
| 45 |
+
},
|
| 46 |
+
"linux": {
|
| 47 |
+
"miDebuggerPath": "mips-mti-elf-gdb"
|
| 48 |
+
},
|
| 49 |
+
"setupCommands": [
|
| 50 |
+
{"text": "cd ${fileDirname}"},
|
| 51 |
+
{"text": "file program.elf"},
|
| 52 |
+
{"text": "target remote | openocd -f ../../scripts/load/openocd.cfg -p -c 'log_output openocd.log'"},
|
| 53 |
+
{"text": "set endian little"}
|
| 54 |
+
],
|
| 55 |
+
"customLaunchSetupCommands": [],
|
| 56 |
+
"launchCompleteCommand": "None",
|
| 57 |
+
"targetArchitecture": "mips"
|
| 58 |
+
|
| 59 |
+
//Uncomment this to debug
|
| 60 |
+
//,"logging": { "engineLogging": true }
|
| 61 |
+
//or this for verbose debug
|
| 62 |
+
//,"logging": { "engineLogging": true, "trace": true, "traceResponse": true }
|
| 63 |
+
}
|
| 64 |
+
]
|
| 65 |
+
}
|
MIPSfpga_mipsfpga-plus/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIPSfpga+ / mipsfpga-plus / MFP is a cleaned-up and improved variant of MIPSfpga-based system defined in MIPSfpga Getting Started package (MFGS). The new features include:
|
| 2 |
+
|
| 3 |
+
<ol>
|
| 4 |
+
<li>The ability to load a software program using ubiquitous $5 FTDI-based USB-to-UART connector instead of $50 Bus Blaster that is difficult to get in some places of the globe</li>
|
| 5 |
+
<li>The ability to change the clock frequency on the fly from 50 or 25 MHz down to 1 Hz (one cycle a second) to observe the work of CPU in real time, including cache misses and pipeline forwarding</li>
|
| 6 |
+
<li>An example of integration of a light sensor with SPI protocol</li>
|
| 7 |
+
<li>Smaller software initialization sequence that fits in 1 KB instead of 32 KB memory, which allows porting MIPSfpga to a wider selection of FPGA boards, without using external memory</li>
|
| 8 |
+
<li>Miscellaneous fixes like improving AHB-Lite slave to handle narrow uncached writes of sizes 1 or 2-bytes</li>
|
| 9 |
+
<li>Easy to use configurable SDRAM interface module</li>
|
| 10 |
+
<li>Altera MAX10 ADC interface module support</li>
|
| 11 |
+
<li>Widely used UART16550 interface module</li>
|
| 12 |
+
<li>External interrupt controller that is working throw MIPS microAptiv core Interrupt Interface</li>
|
| 13 |
+
</ol>
|
| 14 |
+
|
| 15 |
+
The hierarchy of synthesizable modules for Digilent Nexys 4 DDR with Xilinx Artix-7 FPGA:
|
| 16 |
+
|
| 17 |
+
<a href="https://cdn.rawgit.com/zhelnio/mipsfpga-plus/a36be531/documentation/edited_figures/hierarchy_nexys4_ddr_full.html"><img src="https://raw.githubusercontent.com/zhelnio/mipsfpga-plus/master/documentation/edited_figures/hierarchy_nexys4_ddr_full.png"></a>
|
| 18 |
+
|
| 19 |
+
MIPSfpga+ currently works on these FPGA boards:
|
| 20 |
+
|
| 21 |
+
<ol>
|
| 22 |
+
<li><a href="http://store.digilentinc.com/nexys-4-ddr-artix-7-fpga-trainer-board-recommended-for-ece-curriculum/">Digilent Nexys 4 DDR</a> board with Xilinx Artix-7 FPGA. See the Appendix A about how the board is connected with the applicable peripherals.</li>
|
| 23 |
+
<li><a href="http://store.digilentinc.com/nexys-4-artix-7-fpga-trainer-board-limited-time-see-nexys4-ddr/">Digilent Nexys 4</a> board with Xilinx Artix-7 FPGA (no DDR, soon to be discontinued).</li>
|
| 24 |
+
<li><a href="http://store.digilentinc.com/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users/">Digilent Basys 3</a> with Xilinx Artix-7.</li>
|
| 25 |
+
<li><a href="http://de0-cv.terasic.com.tw">Terasic DE0-CV</a> with Altera Cyclone V. See the Appendix B about how the board is connected with the applicable peripherals.</li>
|
| 26 |
+
<li><a href="http://de2-115.terasic.com">Terasic DE2-115</a> with Altera Cyclone IV</li>
|
| 27 |
+
<li><a href="http://de0-nano.terasic.com.tw">Terasic DE0-Nano</a> board with Altera Cyclone IV FPGA.</li>
|
| 28 |
+
<li><a href="http://de0.terasic.com">Terasic DE0</a> with Altera Cyclone III</li>
|
| 29 |
+
<li><a href="http://de1.terasic.com">Terasic DE1</a> with Altera Cyclone II</li>
|
| 30 |
+
<li><a href="http://de10-lite.terasic.com">Terasic DE10-Lite</a> with Altera MAX10</li>
|
| 31 |
+
<li><a href="http://de10-nano.terasic.com">Terasic DE10-Nano</a> with Altera Cyclone V</li>
|
| 32 |
+
</ol>
|
| 33 |
+
|
| 34 |
+
There are three planned ports:
|
| 35 |
+
|
| 36 |
+
<ol>
|
| 37 |
+
<li><a href="http://marsohod.org/plata-marsokhod3">Marsohod 3</a> board with Altera MAX10 FPGA</li>
|
| 38 |
+
<li><a href="http://store.digilentinc.com/arty-board-artix-7-fpga-development-board-for-makers-and-hobbyists/">Digilent Arty</a> with Xilinx Artix-7. MIPSfpga+ is likely to work on this board with no modification except adding the board wrapper (top-level Verilog and pin constraints).</li>
|
| 39 |
+
<li><a href="http://de2.terasic.com">Terasic DE2</a> with Altera Cyclone II</li>
|
| 40 |
+
</ol>
|
| 41 |
+
|
| 42 |
+
The source code for MIPSfpga+ is located at <a href="http://github.com/MIPSfpga/mipsfpga-plus">http://github.com/MIPSfpga/mipsfpga-plus</a>; this code does not include any source code of MIPS microAptiv UP CPU core from MIPSfpga Getting Started package. A user of MIPSfpga+ is supposed to download Getting Started package from Imagination Technologies web site: <a href="https://community.imgtec.com/downloads/mipsfpga-getting-started-guide-2-0/">MIPSfpga Getting Started Guide 2.0</a> or <a href="http://community.imgtec.com/downloads/mipsfpga-getting-started-v1-3">MIPSfpga Getting Started Guide 1.3</a>.
|
| 43 |
+
|
| 44 |
+
After downloading both MIPSfpga from Imagination site and MIPSfpga+ from GitHub, the user is expected to install MIPSfpga under 64-bit Microsoft Windows (either Windows 7 or Windows 8) by placing MIPSfpga core source files to MIPSfpga+\core directory. To do this one need to copy to MIPSfpga+\core all the files from 'MIPSfpga_GSG_1.3\MIPSfpga\rtl_up' when using MIPSfpga 1.3 or from 'MIPSfpga_GSG_v2.0\MIPSfpga_GSG\rtl_up\core' in the case of using MIPSfpga 2.0. The paths inside MIPSfpga+ synthesis and simulation scripts rely on such installation.
|
| 45 |
+
|
| 46 |
+
MIPSfpga+ (as well as the original MFGS package) can be also used on a workstation with 32-bit Windows, 32-bit Linux, 64-bit Linux, with or without Windows or Linux virtual machine. It is possible to install MIPSfpga+ in different directories, and use it with a number of Verilog simulators and synthesis tools: Synopsys VCS, Cadence IES, Mentor ModelSim, Icarus Verilog with GTKWave, Xilinx ISim and Vivado, Altera Quartus II, Synopsys Synplify Pro and others. Some usage scenarios require modifying the scripts and adhering to specific versions of EDA and software development tools, for example:
|
| 47 |
+
|
| 48 |
+
<ul>
|
| 49 |
+
<li>In order to use MIPSfpga or MIPSfpga+ on a workstation with 32-bit Windows, it is necessary to use <a href="https://sourcery.mentor.com/GNUToolchain/subscription3537?lite=MIPS">Mentor Sourcery CodeBench Lite Edition for MIPS ELF</a> instead of <a href="https://community.imgtec.com/developers/mips/tools/codescape-mips-sdk/download-codescape-mips-sdk-essentials/">Imagination Codescape MIPS SDK Essentials</a>. This requires some minimal modifications of certain scripts (changing the program name prefixes).</li>
|
| 50 |
+
<li>In order to use MIPSfpga or MIPSfpga+ with Altera FPGAs on a workstation with 32-bit Windows <i>or</i> 32-Linux, it is necessary to use <a href="http://dl.altera.com/13.1/?edition=web">Altera Quartus II Web Edition version 13.1</a> instead of the latest <a href="http://dl.altera.com/15.1/?edition=lite">version 15.1</a> that does not work on workstations with 32-bit operating systems.</li>
|
| 51 |
+
</ul>
|
| 52 |
+
|
| 53 |
+
How to synthesize mipsfpga-plus for Terasic DE0-CV board:
|
| 54 |
+
|
| 55 |
+
<ol>
|
| 56 |
+
<li>Unzip MIPSfpga 2.0 Getting Started Guide to C:\MIPSfpga</li>
|
| 57 |
+
<li>Get mipsfpgfa-plus into C:\github\mipsfpga-plus</li>
|
| 58 |
+
<li>copy all the files from C:\MIPSfpga\MIPSfpga_GSG\rtl_up\core to C:\github\mipsfpga-plus\core</li>
|
| 59 |
+
<li>cd C:\github\mipsfpga-plus\boards\de0_cv</li>
|
| 60 |
+
<li>make_project.bat</li>
|
| 61 |
+
<li>Run Altera Quartus II</li>
|
| 62 |
+
<li>Open project C:\github\mipsfpga-plus\boards\de0_cv\project\de0_cv.qpf</li>
|
| 63 |
+
<li>Analyze/Synthesize/Place&Route/Assemble</li>
|
| 64 |
+
<li>Open Device / Hardware Setup / ByteBlaster / Set file / ouput_files / de0_cv.sof / Start</li>
|
| 65 |
+
</ol>
|
| 66 |
+
|
| 67 |
+
How to load a software example into mipsfpga-plus using BusBlaster and OpenOCD:
|
| 68 |
+
|
| 69 |
+
<pre>
|
| 70 |
+
cd C:\github\mipsfpga-plus\programs\00_counter
|
| 71 |
+
02_compile_and_link.bat
|
| 72 |
+
11_upload_to_the_board.bat
|
| 73 |
+
</pre>
|
| 74 |
+
|
| 75 |
+
How to load a software example into mipsfpga-plus using USB-to-UART-based serial loader:
|
| 76 |
+
|
| 77 |
+
<pre>
|
| 78 |
+
cd C:\github\mipsfpga-plus\programs\00_counter
|
| 79 |
+
02_compile_and_link.bat
|
| 80 |
+
08_generate_motorola_s_record_file.bat
|
| 81 |
+
09_check_which_com_port_is_used.bat
|
| 82 |
+
</pre>
|
| 83 |
+
|
| 84 |
+
Modify <i>10_upload_to_the_board_using_uart.bat</i>.
|
| 85 |
+
|
| 86 |
+
<pre>
|
| 87 |
+
10_upload_to_the_board_using_uart.bat
|
| 88 |
+
</pre>
|
| 89 |
+
|
| 90 |
+
Some details about scripts using: <a href="programs/README.md">programs/README.md</a>
|
| 91 |
+
|
| 92 |
+
|
MIPSfpga_mipsfpga-plus/boards/basys3/basys3.v
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module basys3
|
| 4 |
+
(
|
| 5 |
+
input clk,
|
| 6 |
+
|
| 7 |
+
input btnC,
|
| 8 |
+
input btnU,
|
| 9 |
+
input btnL,
|
| 10 |
+
input btnR,
|
| 11 |
+
input btnD,
|
| 12 |
+
|
| 13 |
+
input [15:0] sw,
|
| 14 |
+
|
| 15 |
+
output [15:0] led,
|
| 16 |
+
|
| 17 |
+
output [ 6:0] seg,
|
| 18 |
+
output dp,
|
| 19 |
+
output [ 3:0] an,
|
| 20 |
+
|
| 21 |
+
inout [ 7:0] JA,
|
| 22 |
+
inout [ 7:0] JB,
|
| 23 |
+
|
| 24 |
+
input RsRx
|
| 25 |
+
);
|
| 26 |
+
|
| 27 |
+
wire clock;
|
| 28 |
+
wire reset = btnU;
|
| 29 |
+
|
| 30 |
+
`define MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 31 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 32 |
+
|
| 33 |
+
wire muxed_clk;
|
| 34 |
+
wire [1:0] sw_db;
|
| 35 |
+
|
| 36 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 37 |
+
# (.WIDTH (2))
|
| 38 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 39 |
+
(
|
| 40 |
+
.clk ( clk ),
|
| 41 |
+
.sw_in ( sw [1:0] ),
|
| 42 |
+
.sw_out ( sw_db )
|
| 43 |
+
);
|
| 44 |
+
|
| 45 |
+
mfp_clock_divider_100_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 46 |
+
mfp_clock_divider_100_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 47 |
+
(
|
| 48 |
+
.clki ( clk ),
|
| 49 |
+
.sel_lo ( sw_db [0] ),
|
| 50 |
+
.sel_mid ( sw_db [1] ),
|
| 51 |
+
.clko ( muxed_clk )
|
| 52 |
+
);
|
| 53 |
+
|
| 54 |
+
BUFG BUFG_slow_clk (.O ( clock ), .I ( muxed_clk ));
|
| 55 |
+
|
| 56 |
+
`else
|
| 57 |
+
|
| 58 |
+
clk_wiz_0 clk_wiz_0 (.clk_in1 (clk), .clk_out1 (clock));
|
| 59 |
+
|
| 60 |
+
`endif
|
| 61 |
+
|
| 62 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 63 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 64 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 65 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 66 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 67 |
+
|
| 68 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 16 { 1'b0 } } , sw [15:0] };
|
| 69 |
+
|
| 70 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 5 { 1'b0 } } ,
|
| 71 |
+
btnU, btnD, btnL, btnC, btnR };
|
| 72 |
+
|
| 73 |
+
assign led = IO_GreenLEDs [15:0];
|
| 74 |
+
|
| 75 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 76 |
+
wire HWRITE;
|
| 77 |
+
|
| 78 |
+
wire ejtag_tck_in, ejtag_tck;
|
| 79 |
+
|
| 80 |
+
IBUF IBUF (.O ( ejtag_tck_in ), .I ( JB [3] ));
|
| 81 |
+
BUFG BUFG_ejtag_tck (.O ( ejtag_tck ), .I ( ejtag_tck_in ));
|
| 82 |
+
|
| 83 |
+
mfp_system mfp_system
|
| 84 |
+
(
|
| 85 |
+
.SI_ClkIn ( clock ),
|
| 86 |
+
.SI_Reset ( reset ),
|
| 87 |
+
|
| 88 |
+
.HADDR ( HADDR ),
|
| 89 |
+
.HRDATA ( HRDATA ),
|
| 90 |
+
.HWDATA ( HWDATA ),
|
| 91 |
+
.HWRITE ( HWRITE ),
|
| 92 |
+
|
| 93 |
+
.EJ_TRST_N_probe ( JB [4] ),
|
| 94 |
+
.EJ_TDI ( JB [1] ),
|
| 95 |
+
.EJ_TDO ( JB [2] ),
|
| 96 |
+
.EJ_TMS ( JB [0] ),
|
| 97 |
+
.EJ_TCK ( ejtag_tck_in ),
|
| 98 |
+
.SI_ColdReset ( ~ JB [5] ),
|
| 99 |
+
.EJ_DINT ( 1'b0 ),
|
| 100 |
+
|
| 101 |
+
.IO_Switches ( IO_Switches ),
|
| 102 |
+
.IO_Buttons ( IO_Buttons ),
|
| 103 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 104 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 105 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 106 |
+
|
| 107 |
+
.UART_RX ( RsRx /* Alternative: JA [7] */ ),
|
| 108 |
+
.UART_TX ( /* TODO */ ),
|
| 109 |
+
|
| 110 |
+
.SPI_CS ( JA [0] ),
|
| 111 |
+
.SPI_SCK ( JA [3] ),
|
| 112 |
+
.SPI_SDO ( JA [2] )
|
| 113 |
+
);
|
| 114 |
+
|
| 115 |
+
assign JA [4] = 1'b0;
|
| 116 |
+
|
| 117 |
+
wire display_clock;
|
| 118 |
+
|
| 119 |
+
mfp_clock_divider_100_MHz_to_763_Hz mfp_clock_divider_100_MHz_to_763_Hz
|
| 120 |
+
(clk, display_clock);
|
| 121 |
+
|
| 122 |
+
wire [7:0] anodes;
|
| 123 |
+
assign an = anodes [3:0];
|
| 124 |
+
|
| 125 |
+
mfp_multi_digit_display multi_digit_display
|
| 126 |
+
(
|
| 127 |
+
.clock ( display_clock ),
|
| 128 |
+
.resetn ( ~ reset ),
|
| 129 |
+
.number ( IO_7_SegmentHEX ),
|
| 130 |
+
|
| 131 |
+
.seven_segments ( seg ),
|
| 132 |
+
.dot ( dp ),
|
| 133 |
+
.anodes ( anodes )
|
| 134 |
+
);
|
| 135 |
+
|
| 136 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/basys3/system_create.tcl
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# path where project will be created
|
| 3 |
+
set project_path [pwd]
|
| 4 |
+
set script_path [file dirname [file normalize [info script]]]
|
| 5 |
+
|
| 6 |
+
# global settings
|
| 7 |
+
set project_name "system"
|
| 8 |
+
set project_part "xc7a35tcpg236-1"
|
| 9 |
+
set testbench_top "mfp_testbench"
|
| 10 |
+
|
| 11 |
+
# source files path
|
| 12 |
+
set rtl_path $project_path/../rtl
|
| 13 |
+
set tb_path $project_path/../tb
|
| 14 |
+
|
| 15 |
+
# project local settings
|
| 16 |
+
set source_files [list \
|
| 17 |
+
"[file normalize "../basys3.v"]" \
|
| 18 |
+
"[file normalize "../../../system_rtl/mfp_ahb_gpio_slave.v"]" \
|
| 19 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_adc_max10.v"]" \
|
| 20 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_eic.v"]" \
|
| 21 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix_config.vh"]" \
|
| 22 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix.v"]" \
|
| 23 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix_with_loader.v"]" \
|
| 24 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_pmod_als.v"]" \
|
| 25 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_slave.v"]" \
|
| 26 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_uart16550.v"]" \
|
| 27 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite.vh"]" \
|
| 28 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_busy.v"]" \
|
| 29 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_sdram.v"]" \
|
| 30 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_slave.v"]" \
|
| 31 |
+
"[file normalize "../../../system_rtl/mfp_clock_dividers.v"]" \
|
| 32 |
+
"[file normalize "../../../system_rtl/mfp_dual_port_ram.v"]" \
|
| 33 |
+
"[file normalize "../../../system_rtl/mfp_eic_core.v"]" \
|
| 34 |
+
"[file normalize "../../../system_rtl/mfp_eic_core.vh"]" \
|
| 35 |
+
"[file normalize "../../../system_rtl/mfp_eic_handler.v"]" \
|
| 36 |
+
"[file normalize "../../../system_rtl/mfp_pmod_als_spi_receiver.v"]" \
|
| 37 |
+
"[file normalize "../../../system_rtl/mfp_priority_encoder.v"]" \
|
| 38 |
+
"[file normalize "../../../system_rtl/mfp_register.v"]" \
|
| 39 |
+
"[file normalize "../../../system_rtl/mfp_seven_segment_displays.v"]" \
|
| 40 |
+
"[file normalize "../../../system_rtl/mfp_srec_parser_to_ahb_lite_bridge.v"]" \
|
| 41 |
+
"[file normalize "../../../system_rtl/mfp_srec_parser.v"]" \
|
| 42 |
+
"[file normalize "../../../system_rtl/mfp_switch_and_button_debouncers.v"]" \
|
| 43 |
+
"[file normalize "../../../system_rtl/mfp_system.v"]" \
|
| 44 |
+
"[file normalize "../../../system_rtl/mfp_uart_loader.v"]" \
|
| 45 |
+
"[file normalize "../../../system_rtl/mfp_uart_receiver.v"]" \
|
| 46 |
+
"[file normalize "../../../system_rtl/uart16550/raminfr.v"]" \
|
| 47 |
+
"[file normalize "../../../system_rtl/uart16550/uart_defines.vh"]" \
|
| 48 |
+
"[file normalize "../../../system_rtl/uart16550/uart_receiver.v"]" \
|
| 49 |
+
"[file normalize "../../../system_rtl/uart16550/uart_regs.v"]" \
|
| 50 |
+
"[file normalize "../../../system_rtl/uart16550/uart_rfifo.v"]" \
|
| 51 |
+
"[file normalize "../../../system_rtl/uart16550/uart_sync_flops.v"]" \
|
| 52 |
+
"[file normalize "../../../system_rtl/uart16550/uart_tfifo.v"]" \
|
| 53 |
+
"[file normalize "../../../system_rtl/uart16550/uart_transmitter.v"]" \
|
| 54 |
+
"[file normalize "../../../core/dataram_2k2way_xilinx.v"]" \
|
| 55 |
+
"[file normalize "../../../core/d_wsram_2k2way_xilinx.v"]" \
|
| 56 |
+
"[file normalize "../../../core/i_wsram_2k2way_xilinx.v"]" \
|
| 57 |
+
"[file normalize "../../../core/m14k_alu_dsp_stub.v"]" \
|
| 58 |
+
"[file normalize "../../../core/m14k_alu_shft_32bit.v"]" \
|
| 59 |
+
"[file normalize "../../../core/m14k_bistctl.v"]" \
|
| 60 |
+
"[file normalize "../../../core/m14k_biu.v"]" \
|
| 61 |
+
"[file normalize "../../../core/m14k_cache_cmp.v"]" \
|
| 62 |
+
"[file normalize "../../../core/m14k_cache_mux.v"]" \
|
| 63 |
+
"[file normalize "../../../core/m14k_cdmm_ctl.v"]" \
|
| 64 |
+
"[file normalize "../../../core/m14k_cdmm_mpustub.v"]" \
|
| 65 |
+
"[file normalize "../../../core/m14k_cdmmstub.v"]" \
|
| 66 |
+
"[file normalize "../../../core/m14k_cdmm.v"]" \
|
| 67 |
+
"[file normalize "../../../core/m14k_clockandlatch.v"]" \
|
| 68 |
+
"[file normalize "../../../core/m14k_clock_buf.v"]" \
|
| 69 |
+
"[file normalize "../../../core/m14k_clock_nogate.v"]" \
|
| 70 |
+
"[file normalize "../../../core/m14k_clockxnorgate.v"]" \
|
| 71 |
+
"[file normalize "../../../core/m14k_config.vh"]" \
|
| 72 |
+
"[file normalize "../../../core/m14k_const.vh"]" \
|
| 73 |
+
"[file normalize "../../../core/m14k_cop1_stub.v"]" \
|
| 74 |
+
"[file normalize "../../../core/m14k_cop2_stub.v"]" \
|
| 75 |
+
"[file normalize "../../../core/m14k_core.v"]" \
|
| 76 |
+
"[file normalize "../../../core/m14k_cp1_stub.v"]" \
|
| 77 |
+
"[file normalize "../../../core/m14k_cp2_stub.v"]" \
|
| 78 |
+
"[file normalize "../../../core/m14k_cpu.v"]" \
|
| 79 |
+
"[file normalize "../../../core/m14k_cpz_antitamper_stub.v"]" \
|
| 80 |
+
"[file normalize "../../../core/m14k_cpz_eicoffset_stub.v"]" \
|
| 81 |
+
"[file normalize "../../../core/m14k_cpz_guest_srs1.v"]" \
|
| 82 |
+
"[file normalize "../../../core/m14k_cpz_guest_stub.v"]" \
|
| 83 |
+
"[file normalize "../../../core/m14k_cpz_pc_top.v"]" \
|
| 84 |
+
"[file normalize "../../../core/m14k_cpz_pc.v"]" \
|
| 85 |
+
"[file normalize "../../../core/m14k_cpz_prid.v"]" \
|
| 86 |
+
"[file normalize "../../../core/m14k_cpz_root_stub.v"]" \
|
| 87 |
+
"[file normalize "../../../core/m14k_cpz_sps_stub.v"]" \
|
| 88 |
+
"[file normalize "../../../core/m14k_cpz_srs1.v"]" \
|
| 89 |
+
"[file normalize "../../../core/m14k_cpz.v"]" \
|
| 90 |
+
"[file normalize "../../../core/m14k_cpz_watch_stub.v"]" \
|
| 91 |
+
"[file normalize "../../../core/m14k_cscramble_scanio_stub.v"]" \
|
| 92 |
+
"[file normalize "../../../core/m14k_cscramble_stub.v"]" \
|
| 93 |
+
"[file normalize "../../../core/m14k_cscramble_tpl.v"]" \
|
| 94 |
+
"[file normalize "../../../core/m14k_dc_bistctl.v"]" \
|
| 95 |
+
"[file normalize "../../../core/m14k_dcc_fb.v"]" \
|
| 96 |
+
"[file normalize "../../../core/m14k_dcc_mb_stub.v"]" \
|
| 97 |
+
"[file normalize "../../../core/m14k_dcc_parity_stub.v"]" \
|
| 98 |
+
"[file normalize "../../../core/m14k_dcc_spmb_stub.v"]" \
|
| 99 |
+
"[file normalize "../../../core/m14k_dcc_spstub.v"]" \
|
| 100 |
+
"[file normalize "../../../core/m14k_dcc.v"]" \
|
| 101 |
+
"[file normalize "../../../core/m14k_dc.v"]" \
|
| 102 |
+
"[file normalize "../../../core/m14k_dsp_const.vh"]" \
|
| 103 |
+
"[file normalize "../../../core/m14k_dspram_ext_stub.v"]" \
|
| 104 |
+
"[file normalize "../../../core/m14k_edp_add_simple.v"]" \
|
| 105 |
+
"[file normalize "../../../core/m14k_edp_buf_misc_pro.v"]" \
|
| 106 |
+
"[file normalize "../../../core/m14k_edp_buf_misc.v"]" \
|
| 107 |
+
"[file normalize "../../../core/m14k_edp_clz_16b.v"]" \
|
| 108 |
+
"[file normalize "../../../core/m14k_edp_clz_4b.v"]" \
|
| 109 |
+
"[file normalize "../../../core/m14k_edp_clz.v"]" \
|
| 110 |
+
"[file normalize "../../../core/m14k_edp.v"]" \
|
| 111 |
+
"[file normalize "../../../core/m14k_ejt_and2.v"]" \
|
| 112 |
+
"[file normalize "../../../core/m14k_ejt_area.v"]" \
|
| 113 |
+
"[file normalize "../../../core/m14k_ejt_async_rec.v"]" \
|
| 114 |
+
"[file normalize "../../../core/m14k_ejt_async_snd.v"]" \
|
| 115 |
+
"[file normalize "../../../core/m14k_ejt_brk21.v"]" \
|
| 116 |
+
"[file normalize "../../../core/m14k_ejt_bus32mux2.v"]" \
|
| 117 |
+
"[file normalize "../../../core/m14k_ejt_dbrk.v"]" \
|
| 118 |
+
"[file normalize "../../../core/m14k_ejt_fifo_1r1w_stub.v"]" \
|
| 119 |
+
"[file normalize "../../../core/m14k_ejt_gate.v"]" \
|
| 120 |
+
"[file normalize "../../../core/m14k_ejt_ibrk.v"]" \
|
| 121 |
+
"[file normalize "../../../core/m14k_ejt_mux2.v"]" \
|
| 122 |
+
"[file normalize "../../../core/m14k_ejt_pdttcb_stub.v"]" \
|
| 123 |
+
"[file normalize "../../../core/m14k_ejt_tap_dasamstub.v"]" \
|
| 124 |
+
"[file normalize "../../../core/m14k_ejt_tap_dasam.v"]" \
|
| 125 |
+
"[file normalize "../../../core/m14k_ejt_tap_fdcstub.v"]" \
|
| 126 |
+
"[file normalize "../../../core/m14k_ejt_tap_fdc.v"]" \
|
| 127 |
+
"[file normalize "../../../core/m14k_ejt_tap_pcsamstub.v"]" \
|
| 128 |
+
"[file normalize "../../../core/m14k_ejt_tap_pcsam.v"]" \
|
| 129 |
+
"[file normalize "../../../core/m14k_ejt_tap.v"]" \
|
| 130 |
+
"[file normalize "../../../core/m14k_ejt_tck.v"]" \
|
| 131 |
+
"[file normalize "../../../core/m14k_ejt_tripsync.v"]" \
|
| 132 |
+
"[file normalize "../../../core/m14k_ejt.v"]" \
|
| 133 |
+
"[file normalize "../../../core/m14k_fpuclk1_nogate.v"]" \
|
| 134 |
+
"[file normalize "../../../core/m14k_gf_mux2.v"]" \
|
| 135 |
+
"[file normalize "../../../core/m14k_glue.v"]" \
|
| 136 |
+
"[file normalize "../../../core/m14k_ic_bistctl.v"]" \
|
| 137 |
+
"[file normalize "../../../core/m14k_icc_mb_stub.v"]" \
|
| 138 |
+
"[file normalize "../../../core/m14k_icc_parity_stub.v"]" \
|
| 139 |
+
"[file normalize "../../../core/m14k_icc_spmb_stub.v"]" \
|
| 140 |
+
"[file normalize "../../../core/m14k_icc_spstub.v"]" \
|
| 141 |
+
"[file normalize "../../../core/m14k_icc_umips_stub.v"]" \
|
| 142 |
+
"[file normalize "../../../core/m14k_icc.v"]" \
|
| 143 |
+
"[file normalize "../../../core/m14k_ic.v"]" \
|
| 144 |
+
"[file normalize "../../../core/m14k_ispram_ext_stub.v"]" \
|
| 145 |
+
"[file normalize "../../../core/m14k_mdl_add_simple.v"]" \
|
| 146 |
+
"[file normalize "../../../core/m14k_mdl_ctl.v"]" \
|
| 147 |
+
"[file normalize "../../../core/m14k_mdl_dp.v"]" \
|
| 148 |
+
"[file normalize "../../../core/m14k_mdl.v"]" \
|
| 149 |
+
"[file normalize "../../../core/m14k_mmuc.v"]" \
|
| 150 |
+
"[file normalize "../../../core/m14k_mmu.vh"]" \
|
| 151 |
+
"[file normalize "../../../core/m14k_mpc_ctl.v"]" \
|
| 152 |
+
"[file normalize "../../../core/m14k_mpc_dec.v"]" \
|
| 153 |
+
"[file normalize "../../../core/m14k_mpc_exc.v"]" \
|
| 154 |
+
"[file normalize "../../../core/m14k_mpc.v"]" \
|
| 155 |
+
"[file normalize "../../../core/m14k_rf_reg.v"]" \
|
| 156 |
+
"[file normalize "../../../core/m14k_rf_rngc.v"]" \
|
| 157 |
+
"[file normalize "../../../core/m14k_rf_stub.v"]" \
|
| 158 |
+
"[file normalize "../../../core/m14k_siu_int_sync.v"]" \
|
| 159 |
+
"[file normalize "../../../core/m14k_siu.v"]" \
|
| 160 |
+
"[file normalize "../../../core/m14k_spram_top.v"]" \
|
| 161 |
+
"[file normalize "../../../core/m14k_tlb_collector.v"]" \
|
| 162 |
+
"[file normalize "../../../core/m14k_tlb_cpy.v"]" \
|
| 163 |
+
"[file normalize "../../../core/m14k_tlb_ctl.v"]" \
|
| 164 |
+
"[file normalize "../../../core/m14k_tlb_dtlb.v"]" \
|
| 165 |
+
"[file normalize "../../../core/m14k_tlb_itlb.v"]" \
|
| 166 |
+
"[file normalize "../../../core/m14k_tlb_jtlb16entries.v"]" \
|
| 167 |
+
"[file normalize "../../../core/m14k_tlb_jtlb16.v"]" \
|
| 168 |
+
"[file normalize "../../../core/m14k_tlb_jtlb1entry.v"]" \
|
| 169 |
+
"[file normalize "../../../core/m14k_tlb_jtlb4entries.v"]" \
|
| 170 |
+
"[file normalize "../../../core/m14k_tlb_utlbentry.v"]" \
|
| 171 |
+
"[file normalize "../../../core/m14k_tlb_utlb.v"]" \
|
| 172 |
+
"[file normalize "../../../core/m14k_tlb.v"]" \
|
| 173 |
+
"[file normalize "../../../core/m14k_top.v"]" \
|
| 174 |
+
"[file normalize "../../../core/m14k_udi_custom.v"]" \
|
| 175 |
+
"[file normalize "../../../core/m14k_udi_scanio_stub.v"]" \
|
| 176 |
+
"[file normalize "../../../core/m14k_udi_stub.v"]" \
|
| 177 |
+
"[file normalize "../../../core/mvp_cregister_c.v"]" \
|
| 178 |
+
"[file normalize "../../../core/mvp_cregister_ngc.v"]" \
|
| 179 |
+
"[file normalize "../../../core/mvp_cregister_s.v"]" \
|
| 180 |
+
"[file normalize "../../../core/mvp_cregister.v"]" \
|
| 181 |
+
"[file normalize "../../../core/mvp_cregister_wide_tlb.v"]" \
|
| 182 |
+
"[file normalize "../../../core/mvp_cregister_wide_utlb.v"]" \
|
| 183 |
+
"[file normalize "../../../core/mvp_cregister_wide.v"]" \
|
| 184 |
+
"[file normalize "../../../core/mvp_latchn.v"]" \
|
| 185 |
+
"[file normalize "../../../core/mvp_mux16.v"]" \
|
| 186 |
+
"[file normalize "../../../core/mvp_mux1hot_10.v"]" \
|
| 187 |
+
"[file normalize "../../../core/mvp_mux1hot_13.v"]" \
|
| 188 |
+
"[file normalize "../../../core/mvp_mux1hot_24.v"]" \
|
| 189 |
+
"[file normalize "../../../core/mvp_mux1hot_3.v"]" \
|
| 190 |
+
"[file normalize "../../../core/mvp_mux1hot_4.v"]" \
|
| 191 |
+
"[file normalize "../../../core/mvp_mux1hot_5.v"]" \
|
| 192 |
+
"[file normalize "../../../core/mvp_mux1hot_6.v"]" \
|
| 193 |
+
"[file normalize "../../../core/mvp_mux1hot_8.v"]" \
|
| 194 |
+
"[file normalize "../../../core/mvp_mux1hot_9.v"]" \
|
| 195 |
+
"[file normalize "../../../core/mvp_mux2.v"]" \
|
| 196 |
+
"[file normalize "../../../core/mvp_mux4.v"]" \
|
| 197 |
+
"[file normalize "../../../core/mvp_mux8.v"]" \
|
| 198 |
+
"[file normalize "../../../core/mvp_register_c.v"]" \
|
| 199 |
+
"[file normalize "../../../core/mvp_register_ngc.v"]" \
|
| 200 |
+
"[file normalize "../../../core/mvp_register_s.v"]" \
|
| 201 |
+
"[file normalize "../../../core/mvp_register.v"]" \
|
| 202 |
+
"[file normalize "../../../core/mvp_ucregister_wide.v"]" \
|
| 203 |
+
"[file normalize "../../../core/RAMB4K_S16.v"]" \
|
| 204 |
+
"[file normalize "../../../core/RAMB4K_S2.v"]" \
|
| 205 |
+
"[file normalize "../../../core/RAMB4K_S8.v"]" \
|
| 206 |
+
"[file normalize "../../../core/ram_dual_port.v"]" \
|
| 207 |
+
"[file normalize "../../../core/ram_reset_dual_port.v"]" \
|
| 208 |
+
"[file normalize "../../../core/tagram_2k2way_xilinx.v"]" \
|
| 209 |
+
]
|
| 210 |
+
|
| 211 |
+
set constr_files [list \
|
| 212 |
+
"[file normalize "../basys3.xdc"]" \
|
| 213 |
+
]
|
| 214 |
+
|
| 215 |
+
set sim_files [list \
|
| 216 |
+
"[file normalize "../../../testbench/sdr_sdram"]" \
|
| 217 |
+
"[file normalize "../../../testbench/sdr_sdram/sdr.v"]" \
|
| 218 |
+
"[file normalize "../../../testbench/sdr_sdram/sdr_parameters.vh"]" \
|
| 219 |
+
"[file normalize "../../../testbench/mfp_testbench.v"]" \
|
| 220 |
+
"[file normalize "../../../testbench/mfp_uart_testbench.v"]" \
|
| 221 |
+
]
|
| 222 |
+
|
| 223 |
+
# create project
|
| 224 |
+
create_project $project_name $project_path -part $project_part -force
|
| 225 |
+
|
| 226 |
+
# fill 'sources_1' fileset
|
| 227 |
+
if {[info exists source_files]} {
|
| 228 |
+
add_files -norecurse -fileset [get_filesets sources_1] $source_files
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
# fill 'constrs_1' fileset
|
| 232 |
+
if {[info exists constr_files]} {
|
| 233 |
+
add_files -norecurse -fileset [get_filesets constrs_1] $constr_files
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
# fill 'sim_1' fileset
|
| 237 |
+
if {[info exists sim_files]} {
|
| 238 |
+
set obj [get_filesets sim_1]
|
| 239 |
+
add_files -norecurse -fileset $obj $sim_files
|
| 240 |
+
set_property top $testbench_top $obj
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
# define macros VIVADO_SYNTHESIS
|
| 244 |
+
set_property -name {STEPS.SYNTH_DESIGN.ARGS.MORE OPTIONS} -value {-verilog_define VIVADO_SYNTHESIS} -objects [get_runs synth_1]
|
| 245 |
+
|
| 246 |
+
puts "INFO: Project created:$project_name"
|
MIPSfpga_mipsfpga-plus/boards/basys3/system_load.tcl
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
set project_name "system"
|
| 3 |
+
set hw_device "xc7a35t_0"
|
| 4 |
+
|
| 5 |
+
open_project "$project_name.xpr"; # open Vivado project
|
| 6 |
+
open_hw; # open the Hardware Manager
|
| 7 |
+
connect_hw_server; # open a connection to a hardware server
|
| 8 |
+
open_hw_target; # connect to the board
|
| 9 |
+
|
| 10 |
+
# set a file to be programmed
|
| 11 |
+
set_property PROGRAM.FILE "$project_name.bit" [get_hw_devices $hw_device];
|
| 12 |
+
|
| 13 |
+
# chip programming
|
| 14 |
+
program_hw_devices [get_hw_devices $hw_device]
|
| 15 |
+
#refresh_hw_device -update_hw_probes false [lindex [get_hw_devices $hw_device] 0]
|
| 16 |
+
|
| 17 |
+
# connections and project closing
|
| 18 |
+
close_hw_target
|
| 19 |
+
disconnect_hw_server
|
| 20 |
+
close_hw
|
| 21 |
+
close_project
|
MIPSfpga_mipsfpga-plus/boards/basys3/system_synth.tcl
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
set project_name "system"
|
| 3 |
+
set synth_task "synth_1"
|
| 4 |
+
set impl_task "impl_1"
|
| 5 |
+
set timing_report "timing_1"
|
| 6 |
+
|
| 7 |
+
open_project "$project_name.xpr"
|
| 8 |
+
|
| 9 |
+
# run synthesis
|
| 10 |
+
launch_runs $synth_task
|
| 11 |
+
wait_on_run -verbose $synth_task
|
| 12 |
+
|
| 13 |
+
# run implementation
|
| 14 |
+
launch_runs $impl_task
|
| 15 |
+
wait_on_run -verbose $impl_task
|
| 16 |
+
|
| 17 |
+
# write bitstream
|
| 18 |
+
open_run $impl_task -name $impl_task
|
| 19 |
+
write_bitstream "$project_name.bit"
|
MIPSfpga_mipsfpga-plus/boards/de0/de0.sdc
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**************************************************************
|
| 2 |
+
# Create Clock
|
| 3 |
+
#**************************************************************
|
| 4 |
+
|
| 5 |
+
create_clock -period 20 [get_ports CLOCK_50_2]
|
| 6 |
+
create_clock -period 20 [get_ports CLOCK_50]
|
| 7 |
+
create_clock -period 40 [get_nets mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz|clko]
|
| 8 |
+
create_clock -period 20 [get_nets de0|clk]
|
| 9 |
+
create_clock -period 20 [get_ports GPIO1_D[14]]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#**************************************************************
|
| 13 |
+
# Create Generated Clock
|
| 14 |
+
#**************************************************************
|
| 15 |
+
derive_pll_clocks
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
#**************************************************************
|
| 23 |
+
# Set Clock Latency
|
| 24 |
+
#**************************************************************
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
#**************************************************************
|
| 28 |
+
# Set Clock Uncertainty
|
| 29 |
+
#**************************************************************
|
| 30 |
+
derive_clock_uncertainty
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
#**************************************************************
|
| 35 |
+
# Set Input Delay
|
| 36 |
+
#**************************************************************
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
#**************************************************************
|
| 41 |
+
# Set Output Delay
|
| 42 |
+
#**************************************************************
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
#**************************************************************
|
| 47 |
+
# Set Clock Groups
|
| 48 |
+
##**************************************************************
|
| 49 |
+
|
| 50 |
+
#**************************************************************
|
| 51 |
+
# Set False Path
|
| 52 |
+
#**************************************************************
|
| 53 |
+
|
| 54 |
+
#**************************************************************
|
| 55 |
+
# Set Multicycle Path
|
| 56 |
+
#**************************************************************
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
#**************************************************************
|
| 61 |
+
# Set Maximum Delay
|
| 62 |
+
#**************************************************************
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
#**************************************************************
|
| 67 |
+
# Set Minimum Delay
|
| 68 |
+
#**************************************************************
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
#**************************************************************
|
| 73 |
+
# Set Input Transition
|
| 74 |
+
#**************************************************************
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
#**************************************************************
|
| 79 |
+
# Set Load
|
| 80 |
+
#**************************************************************
|
| 81 |
+
|
MIPSfpga_mipsfpga-plus/boards/de0/de0.v
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module de0
|
| 4 |
+
(
|
| 5 |
+
input CLOCK_50,
|
| 6 |
+
input CLOCK_50_2,
|
| 7 |
+
input [ 2:0] BUTTON,
|
| 8 |
+
input [ 9:0] SW,
|
| 9 |
+
output [ 6:0] HEX0_D,
|
| 10 |
+
output HEX0_DP,
|
| 11 |
+
output [ 6:0] HEX1_D,
|
| 12 |
+
output HEX1_DP,
|
| 13 |
+
output [ 6:0] HEX2_D,
|
| 14 |
+
output HEX2_DP,
|
| 15 |
+
output [ 6:0] HEX3_D,
|
| 16 |
+
output HEX3_DP,
|
| 17 |
+
output [ 9:0] LEDG,
|
| 18 |
+
|
| 19 |
+
`ifdef UNUSED
|
| 20 |
+
|
| 21 |
+
output UART_TXD,
|
| 22 |
+
input UART_RXD,
|
| 23 |
+
output UART_CTS,
|
| 24 |
+
input UART_RTS,
|
| 25 |
+
inout [15:0] DRAM_DQ,
|
| 26 |
+
output [12:0] DRAM_ADDR,
|
| 27 |
+
output DRAM_LDQM,
|
| 28 |
+
output DRAM_UDQM,
|
| 29 |
+
output DRAM_WE_N,
|
| 30 |
+
output DRAM_CAS_N,
|
| 31 |
+
output DRAM_RAS_N,
|
| 32 |
+
output DRAM_CS_N,
|
| 33 |
+
output DRAM_BA_0,
|
| 34 |
+
output DRAM_BA_1,
|
| 35 |
+
output DRAM_CLK,
|
| 36 |
+
output DRAM_CKE,
|
| 37 |
+
inout [14:0] FL_DQ,
|
| 38 |
+
inout FL_DQ15_AM1,
|
| 39 |
+
output [21:0] FL_ADDR,
|
| 40 |
+
output FL_WE_N,
|
| 41 |
+
output FL_RST_N,
|
| 42 |
+
output FL_OE_N,
|
| 43 |
+
output FL_CE_N,
|
| 44 |
+
output FL_WP_N,
|
| 45 |
+
output FL_BYTE_N,
|
| 46 |
+
input FL_RY,
|
| 47 |
+
inout [ 7:0] LCD_DATA,
|
| 48 |
+
output LCD_BLON,
|
| 49 |
+
output LCD_RW,
|
| 50 |
+
output LCD_EN,
|
| 51 |
+
output LCD_RS,
|
| 52 |
+
inout SD_DAT0,
|
| 53 |
+
inout SD_DAT3,
|
| 54 |
+
inout SD_CMD,
|
| 55 |
+
output SD_CLK,
|
| 56 |
+
input SD_WP_N,
|
| 57 |
+
inout PS2_KBDAT,
|
| 58 |
+
inout PS2_KBCLK,
|
| 59 |
+
inout PS2_MSDAT,
|
| 60 |
+
inout PS2_MSCLK,
|
| 61 |
+
output VGA_HS,
|
| 62 |
+
output VGA_VS,
|
| 63 |
+
output [ 3:0] VGA_R,
|
| 64 |
+
output [ 3:0] VGA_G,
|
| 65 |
+
output [ 3:0] VGA_B,
|
| 66 |
+
|
| 67 |
+
`endif
|
| 68 |
+
|
| 69 |
+
input [ 1:0] GPIO0_CLKIN,
|
| 70 |
+
output [ 1:0] GPIO0_CLKOUT,
|
| 71 |
+
inout [31:0] GPIO0_D,
|
| 72 |
+
input [ 1:0] GPIO1_CLKIN,
|
| 73 |
+
output [ 1:0] GPIO1_CLKOUT,
|
| 74 |
+
inout [31:0] GPIO1_D
|
| 75 |
+
);
|
| 76 |
+
|
| 77 |
+
wire clk;
|
| 78 |
+
|
| 79 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 80 |
+
|
| 81 |
+
wire muxed_clk;
|
| 82 |
+
wire [1:0] sw_db;
|
| 83 |
+
|
| 84 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 85 |
+
# (.WIDTH (2))
|
| 86 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 87 |
+
(
|
| 88 |
+
.clk ( CLOCK_50 ),
|
| 89 |
+
.sw_in ( SW [1:0] ),
|
| 90 |
+
.sw_out ( sw_db )
|
| 91 |
+
);
|
| 92 |
+
|
| 93 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 94 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 95 |
+
(
|
| 96 |
+
.clki ( CLOCK_50 ),
|
| 97 |
+
.sel_lo ( sw_db [0] ),
|
| 98 |
+
.sel_mid ( sw_db [1] ),
|
| 99 |
+
.clko ( muxed_clk )
|
| 100 |
+
);
|
| 101 |
+
|
| 102 |
+
global gclk
|
| 103 |
+
(
|
| 104 |
+
.in ( muxed_clk ),
|
| 105 |
+
.out ( clk )
|
| 106 |
+
);
|
| 107 |
+
|
| 108 |
+
`else
|
| 109 |
+
|
| 110 |
+
assign clk = CLOCK_50;
|
| 111 |
+
|
| 112 |
+
`endif
|
| 113 |
+
|
| 114 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 115 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 116 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 117 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 118 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 119 |
+
|
| 120 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 10 { 1'b0 } } , SW [9:0] };
|
| 121 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 3 { 1'b0 } } , ~ BUTTON [2:0] };
|
| 122 |
+
|
| 123 |
+
assign LEDG = IO_GreenLEDs [9:0];
|
| 124 |
+
|
| 125 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 126 |
+
wire HWRITE;
|
| 127 |
+
|
| 128 |
+
mfp_system mfp_system
|
| 129 |
+
(
|
| 130 |
+
.SI_ClkIn ( clk ),
|
| 131 |
+
.SI_Reset ( ~ BUTTON [0] ),
|
| 132 |
+
|
| 133 |
+
.HADDR ( HADDR ),
|
| 134 |
+
.HRDATA ( HRDATA ),
|
| 135 |
+
.HWDATA ( HWDATA ),
|
| 136 |
+
.HWRITE ( HWRITE ),
|
| 137 |
+
|
| 138 |
+
.EJ_TRST_N_probe ( GPIO1_D [18] ),
|
| 139 |
+
.EJ_TDI ( GPIO1_D [17] ),
|
| 140 |
+
.EJ_TDO ( GPIO1_D [15] ),
|
| 141 |
+
.EJ_TMS ( GPIO1_D [19] ),
|
| 142 |
+
.EJ_TCK ( GPIO1_D [14] ),
|
| 143 |
+
.SI_ColdReset ( ~ GPIO1_D [16] ),
|
| 144 |
+
.EJ_DINT ( 1'b0 ),
|
| 145 |
+
|
| 146 |
+
.IO_Switches ( IO_Switches ),
|
| 147 |
+
.IO_Buttons ( IO_Buttons ),
|
| 148 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 149 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 150 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 151 |
+
|
| 152 |
+
.UART_RX ( GPIO1_D [27] ),
|
| 153 |
+
.UART_TX ( /* TODO */ ),
|
| 154 |
+
|
| 155 |
+
.SPI_CS ( GPIO1_D [30] ),
|
| 156 |
+
.SPI_SCK ( GPIO1_D [24] ),
|
| 157 |
+
.SPI_SDO ( GPIO1_D [26] )
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
assign GPIO1_D [13] = 1'b0;
|
| 161 |
+
assign GPIO1_D [12] = 1'b0;
|
| 162 |
+
assign GPIO1_D [11] = 1'b1;
|
| 163 |
+
assign GPIO1_D [10] = 1'b1;
|
| 164 |
+
|
| 165 |
+
assign GPIO1_D [22] = 1'b0;
|
| 166 |
+
|
| 167 |
+
assign HEX0_DP = 1'b1;
|
| 168 |
+
assign HEX1_DP = 1'b1;
|
| 169 |
+
assign HEX2_DP = 1'b1;
|
| 170 |
+
assign HEX3_DP = 1'b1;
|
| 171 |
+
|
| 172 |
+
mfp_single_digit_seven_segment_display digit_3 ( IO_7_SegmentHEX [15:12] , HEX3_D );
|
| 173 |
+
mfp_single_digit_seven_segment_display digit_2 ( IO_7_SegmentHEX [11: 8] , HEX2_D );
|
| 174 |
+
mfp_single_digit_seven_segment_display digit_1 ( IO_7_SegmentHEX [ 7: 4] , HEX1_D );
|
| 175 |
+
mfp_single_digit_seven_segment_display digit_0 ( IO_7_SegmentHEX [ 3: 0] , HEX0_D );
|
| 176 |
+
|
| 177 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/de0_cv/board_config.vh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//board specific settings
|
| 2 |
+
|
| 3 |
+
//SDRAM parameters for 64MB (Terasic DE0-CV)
|
| 4 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 5 |
+
`define SDRAM_ADDR_BITS 13
|
| 6 |
+
`define SDRAM_ROW_BITS 13
|
| 7 |
+
`define SDRAM_COL_BITS 10
|
| 8 |
+
`define SDRAM_DQ_BITS 16
|
| 9 |
+
`define SDRAM_BA_BITS 2
|
| 10 |
+
`define SDRAM_DM_BITS 2
|
| 11 |
+
`define MFP_RAM_ADDR_WIDTH (`SDRAM_ROW_BITS + `SDRAM_COL_BITS + `SDRAM_BA_BITS)
|
| 12 |
+
|
| 13 |
+
//values for fclk=50 MHz
|
| 14 |
+
`define SDRAM_DELAY_nCKE 10000
|
| 15 |
+
`define SDRAM_DELAY_tREF 360
|
| 16 |
+
`define SDRAM_DELAY_tRP 0
|
| 17 |
+
`define SDRAM_DELAY_tRFC 2
|
| 18 |
+
`define SDRAM_DELAY_tMRD 0
|
| 19 |
+
`define SDRAM_DELAY_tRCD 0
|
| 20 |
+
`define SDRAM_DELAY_tCAS 0
|
| 21 |
+
`define SDRAM_DELAY_afterREAD 0
|
| 22 |
+
`define SDRAM_DELAY_afterWRITE 2
|
| 23 |
+
`define SDRAM_COUNT_initAutoRef 8
|
| 24 |
+
`endif
|
MIPSfpga_mipsfpga-plus/boards/de0_cv/de0_cv.sdc
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**************************************************************
|
| 2 |
+
# Create Clock
|
| 3 |
+
#**************************************************************
|
| 4 |
+
|
| 5 |
+
create_clock -period 20 [get_ports CLOCK2_50]
|
| 6 |
+
create_clock -period 20 [get_ports CLOCK3_50]
|
| 7 |
+
create_clock -period 20 [get_ports CLOCK_50]
|
| 8 |
+
create_clock -period 20 [get_ports CLOCK4_50]
|
| 9 |
+
create_clock -period 40 [get_nets mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz|clko]
|
| 10 |
+
create_clock -period 20 [get_nets de0_cv|clk]
|
| 11 |
+
create_clock -period 20 [get_ports GPIO_1[17]]
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
#**************************************************************
|
| 15 |
+
# Create Generated Clock
|
| 16 |
+
#**************************************************************
|
| 17 |
+
derive_pll_clocks
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
#**************************************************************
|
| 25 |
+
# Set Clock Latency
|
| 26 |
+
#**************************************************************
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
#**************************************************************
|
| 30 |
+
# Set Clock Uncertainty
|
| 31 |
+
#**************************************************************
|
| 32 |
+
derive_clock_uncertainty
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
#**************************************************************
|
| 37 |
+
# Set Input Delay
|
| 38 |
+
#**************************************************************
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
#**************************************************************
|
| 43 |
+
# Set Output Delay
|
| 44 |
+
#**************************************************************
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
#**************************************************************
|
| 49 |
+
# Set Clock Groups
|
| 50 |
+
##**************************************************************
|
| 51 |
+
|
| 52 |
+
#**************************************************************
|
| 53 |
+
# Set False Path
|
| 54 |
+
#**************************************************************
|
| 55 |
+
|
| 56 |
+
#**************************************************************
|
| 57 |
+
# Set Multicycle Path
|
| 58 |
+
#**************************************************************
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
#**************************************************************
|
| 63 |
+
# Set Maximum Delay
|
| 64 |
+
#**************************************************************
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
#**************************************************************
|
| 69 |
+
# Set Minimum Delay
|
| 70 |
+
#**************************************************************
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
#**************************************************************
|
| 75 |
+
# Set Input Transition
|
| 76 |
+
#**************************************************************
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
#**************************************************************
|
| 81 |
+
# Set Load
|
| 82 |
+
#**************************************************************
|
| 83 |
+
|
MIPSfpga_mipsfpga-plus/boards/de0_cv/de0_cv.v
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module de0_cv
|
| 4 |
+
(
|
| 5 |
+
input CLOCK2_50,
|
| 6 |
+
input CLOCK3_50,
|
| 7 |
+
inout CLOCK4_50,
|
| 8 |
+
input CLOCK_50,
|
| 9 |
+
|
| 10 |
+
input RESET_N,
|
| 11 |
+
|
| 12 |
+
input [ 3:0] KEY,
|
| 13 |
+
input [ 9:0] SW,
|
| 14 |
+
|
| 15 |
+
output [ 9:0] LEDR,
|
| 16 |
+
|
| 17 |
+
output [ 6:0] HEX0,
|
| 18 |
+
output [ 6:0] HEX1,
|
| 19 |
+
output [ 6:0] HEX2,
|
| 20 |
+
output [ 6:0] HEX3,
|
| 21 |
+
output [ 6:0] HEX4,
|
| 22 |
+
output [ 6:0] HEX5,
|
| 23 |
+
|
| 24 |
+
output [12:0] DRAM_ADDR,
|
| 25 |
+
output [ 1:0] DRAM_BA,
|
| 26 |
+
output DRAM_CAS_N,
|
| 27 |
+
output DRAM_CKE,
|
| 28 |
+
output DRAM_CLK,
|
| 29 |
+
output DRAM_CS_N,
|
| 30 |
+
inout [15:0] DRAM_DQ,
|
| 31 |
+
output DRAM_LDQM,
|
| 32 |
+
output DRAM_RAS_N,
|
| 33 |
+
output DRAM_UDQM,
|
| 34 |
+
output DRAM_WE_N,
|
| 35 |
+
|
| 36 |
+
output [ 3:0] VGA_B,
|
| 37 |
+
output [ 3:0] VGA_G,
|
| 38 |
+
output VGA_HS,
|
| 39 |
+
output [ 3:0] VGA_R,
|
| 40 |
+
output VGA_VS,
|
| 41 |
+
|
| 42 |
+
inout PS2_CLK,
|
| 43 |
+
inout PS2_CLK2,
|
| 44 |
+
inout PS2_DAT,
|
| 45 |
+
inout PS2_DAT2,
|
| 46 |
+
|
| 47 |
+
output SD_CLK,
|
| 48 |
+
inout SD_CMD,
|
| 49 |
+
inout [ 3:0] SD_DATA,
|
| 50 |
+
|
| 51 |
+
inout [35:0] GPIO_0,
|
| 52 |
+
inout [35:0] GPIO_1
|
| 53 |
+
);
|
| 54 |
+
|
| 55 |
+
wire clk;
|
| 56 |
+
|
| 57 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 58 |
+
|
| 59 |
+
wire muxed_clk;
|
| 60 |
+
wire [1:0] sw_db;
|
| 61 |
+
|
| 62 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 63 |
+
# (.WIDTH (2))
|
| 64 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 65 |
+
(
|
| 66 |
+
.clk ( CLOCK_50 ),
|
| 67 |
+
.sw_in ( SW [1:0] ),
|
| 68 |
+
.sw_out ( sw_db )
|
| 69 |
+
);
|
| 70 |
+
|
| 71 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 72 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 73 |
+
(
|
| 74 |
+
.clki ( CLOCK_50 ),
|
| 75 |
+
.sel_lo ( sw_db [0] ),
|
| 76 |
+
.sel_mid ( sw_db [1] ),
|
| 77 |
+
.clko ( muxed_clk )
|
| 78 |
+
);
|
| 79 |
+
|
| 80 |
+
global gclk
|
| 81 |
+
(
|
| 82 |
+
.in ( muxed_clk ),
|
| 83 |
+
.out ( clk )
|
| 84 |
+
);
|
| 85 |
+
|
| 86 |
+
`else
|
| 87 |
+
|
| 88 |
+
assign clk = CLOCK_50;
|
| 89 |
+
|
| 90 |
+
`endif
|
| 91 |
+
|
| 92 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 93 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 94 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 95 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 96 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 97 |
+
|
| 98 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 10 { 1'b0 } } , SW [9:0] };
|
| 99 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 4 { 1'b0 } } , ~ KEY [3:0] };
|
| 100 |
+
|
| 101 |
+
assign LEDR = IO_GreenLEDs [9:0];
|
| 102 |
+
|
| 103 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 104 |
+
wire HWRITE;
|
| 105 |
+
|
| 106 |
+
`define MFP_EJTAG_DEBUGGER
|
| 107 |
+
`ifdef MFP_EJTAG_DEBUGGER
|
| 108 |
+
// MIPSfpga EJTAG BusBluster 3 connector pinout
|
| 109 |
+
// EJTAG DIRECTION PIN CONN PIN DIRECTION EJTAG
|
| 110 |
+
// ===== ========= ========== ========= ======== ========= ======
|
| 111 |
+
// VCC output GPIO_1[12] 15 | 16 GPIO_1[13] output VCC
|
| 112 |
+
// GND output GPIO_1[14] 17 | 18 GPIO_1[15] output GND
|
| 113 |
+
// NC output GPIO_1[16] 19 | 20 GPIO_1[17] input EJ_TCK
|
| 114 |
+
// NC output GPIO_1[18] 21 | 22 GPIO_1[19] output EJ_TDO
|
| 115 |
+
// EJ_RST input GPIO_1[20] 23 | 24 GPIO_1[21] input EJ_TDI
|
| 116 |
+
// EJ_TRST input GPIO_1[22] 25 | 26 GPIO_1[23] input EJ_TMS
|
| 117 |
+
|
| 118 |
+
wire EJ_VCC = 1'b1;
|
| 119 |
+
wire EJ_GND = 1'b0;
|
| 120 |
+
wire EJ_NC = 1'bz;
|
| 121 |
+
wire EJ_TCK = GPIO_1[17];
|
| 122 |
+
wire EJ_RST = GPIO_1[20];
|
| 123 |
+
wire EJ_TDI = GPIO_1[21];
|
| 124 |
+
wire EJ_TRST = GPIO_1[22];
|
| 125 |
+
wire EJ_TMS = GPIO_1[23];
|
| 126 |
+
wire EJ_DINT = 1'b0;
|
| 127 |
+
wire EJ_TDO;
|
| 128 |
+
|
| 129 |
+
assign GPIO_1[12] = EJ_VCC;
|
| 130 |
+
assign GPIO_1[13] = EJ_VCC;
|
| 131 |
+
assign GPIO_1[14] = EJ_GND;
|
| 132 |
+
assign GPIO_1[15] = EJ_GND;
|
| 133 |
+
assign GPIO_1[16] = EJ_NC;
|
| 134 |
+
assign GPIO_1[18] = EJ_NC;
|
| 135 |
+
assign GPIO_1[19] = EJ_TDO;
|
| 136 |
+
`endif
|
| 137 |
+
|
| 138 |
+
`ifdef MFP_DEMO_LIGHT_SENSOR
|
| 139 |
+
// ALS CONN PIN DIRECTION
|
| 140 |
+
// ===== ====== ===== =============
|
| 141 |
+
// VCC JP2 29 3.3V
|
| 142 |
+
// GND JP2 31 GPIO_1[26] output
|
| 143 |
+
// SCK JP2 33 GPIO_1[28] output
|
| 144 |
+
// SDO JP2 35 GPIO_1[30] input
|
| 145 |
+
// NC JP2 37 GPIO_1[32] not connected
|
| 146 |
+
// CS JP2 39 GPIO_1[34] output
|
| 147 |
+
|
| 148 |
+
wire ALS_GND = 1'b0;
|
| 149 |
+
wire ALS_SCK;
|
| 150 |
+
wire ALS_SDO;
|
| 151 |
+
wire ALS_NC = 1'bz;
|
| 152 |
+
wire ALS_CS;
|
| 153 |
+
|
| 154 |
+
assign GPIO_1[26] = ALS_GND;
|
| 155 |
+
assign GPIO_1[28] = ALS_SCK;
|
| 156 |
+
assign ALS_SDO = GPIO_1[30];
|
| 157 |
+
assign GPIO_1[32] = ALS_NC;
|
| 158 |
+
assign GPIO_1[34] = ALS_CS;
|
| 159 |
+
`endif
|
| 160 |
+
|
| 161 |
+
mfp_system mfp_system
|
| 162 |
+
(
|
| 163 |
+
.SI_ClkIn ( clk ),
|
| 164 |
+
.SI_Reset ( ~ RESET_N ),
|
| 165 |
+
|
| 166 |
+
.HADDR ( HADDR ),
|
| 167 |
+
.HRDATA ( HRDATA ),
|
| 168 |
+
.HWDATA ( HWDATA ),
|
| 169 |
+
.HWRITE ( HWRITE ),
|
| 170 |
+
|
| 171 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 172 |
+
.SDRAM_CKE ( DRAM_CKE ),
|
| 173 |
+
.SDRAM_CSn ( DRAM_CS_N ),
|
| 174 |
+
.SDRAM_RASn ( DRAM_RAS_N ),
|
| 175 |
+
.SDRAM_CASn ( DRAM_CAS_N ),
|
| 176 |
+
.SDRAM_WEn ( DRAM_WE_N ),
|
| 177 |
+
.SDRAM_ADDR ( DRAM_ADDR ),
|
| 178 |
+
.SDRAM_BA ( DRAM_BA ),
|
| 179 |
+
.SDRAM_DQ ( DRAM_DQ ),
|
| 180 |
+
.SDRAM_DQM ( {DRAM_UDQM, DRAM_LDQM} ),
|
| 181 |
+
`endif
|
| 182 |
+
|
| 183 |
+
`ifdef MFP_EJTAG_DEBUGGER
|
| 184 |
+
.EJ_TRST_N_probe ( EJ_TRST ),
|
| 185 |
+
.EJ_TDI ( EJ_TDI ),
|
| 186 |
+
.EJ_TDO ( EJ_TDO ),
|
| 187 |
+
.EJ_TMS ( EJ_TMS ),
|
| 188 |
+
.EJ_TCK ( EJ_TCK ),
|
| 189 |
+
.SI_ColdReset ( ~ EJ_RST ),
|
| 190 |
+
.EJ_DINT ( EJ_DINT ),
|
| 191 |
+
`endif
|
| 192 |
+
|
| 193 |
+
.IO_Switches ( IO_Switches ),
|
| 194 |
+
.IO_Buttons ( IO_Buttons ),
|
| 195 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 196 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 197 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 198 |
+
|
| 199 |
+
`ifdef MFP_DEMO_LIGHT_SENSOR
|
| 200 |
+
.SPI_CS ( ALS_CS ),
|
| 201 |
+
.SPI_SCK ( ALS_SCK ),
|
| 202 |
+
.SPI_SDO ( ALS_SDO ),
|
| 203 |
+
`endif
|
| 204 |
+
|
| 205 |
+
.UART_RX ( GPIO_1 [31] ),
|
| 206 |
+
.UART_TX ( /* TODO */ )
|
| 207 |
+
);
|
| 208 |
+
|
| 209 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 210 |
+
//SDRAM controller delay params
|
| 211 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_nCKE = `SDRAM_DELAY_nCKE;
|
| 212 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tREF = `SDRAM_DELAY_tREF;
|
| 213 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tRP = `SDRAM_DELAY_tRP;
|
| 214 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tRFC = `SDRAM_DELAY_tRFC;
|
| 215 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tMRD = `SDRAM_DELAY_tMRD;
|
| 216 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tRCD = `SDRAM_DELAY_tRCD;
|
| 217 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tCAS = `SDRAM_DELAY_tCAS;
|
| 218 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_afterREAD = `SDRAM_DELAY_afterREAD;
|
| 219 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_afterWRITE = `SDRAM_DELAY_afterWRITE;
|
| 220 |
+
defparam mfp_system.matrix_loader.matrix.ram.COUNT_initAutoRef = `SDRAM_COUNT_initAutoRef;
|
| 221 |
+
`endif
|
| 222 |
+
|
| 223 |
+
mfp_single_digit_seven_segment_display digit_5 ( IO_7_SegmentHEX [23:20] , HEX5 );
|
| 224 |
+
mfp_single_digit_seven_segment_display digit_4 ( IO_7_SegmentHEX [19:16] , HEX4 );
|
| 225 |
+
mfp_single_digit_seven_segment_display digit_3 ( IO_7_SegmentHEX [15:12] , HEX3 );
|
| 226 |
+
mfp_single_digit_seven_segment_display digit_2 ( IO_7_SegmentHEX [11: 8] , HEX2 );
|
| 227 |
+
mfp_single_digit_seven_segment_display digit_1 ( IO_7_SegmentHEX [ 7: 4] , HEX1 );
|
| 228 |
+
mfp_single_digit_seven_segment_display digit_0 ( IO_7_SegmentHEX [ 3: 0] , HEX0 );
|
| 229 |
+
|
| 230 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/de0_nano/de0_nano.sdc
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**************************************************************
|
| 2 |
+
# This .sdc file is created by Terasic Tool.
|
| 3 |
+
# Users are recommended to modify this file to match users logic.
|
| 4 |
+
#**************************************************************
|
| 5 |
+
|
| 6 |
+
#**************************************************************
|
| 7 |
+
# Create Clock
|
| 8 |
+
#**************************************************************
|
| 9 |
+
create_clock -period 20 [get_ports CLOCK_50]
|
| 10 |
+
create_clock -period 40 [get_nets mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz|clko]
|
| 11 |
+
create_clock -period 20 [get_nets de0_nano|clk]
|
| 12 |
+
create_clock -period 20 [get_ports GPIO_0_D[15]]
|
| 13 |
+
|
| 14 |
+
#**************************************************************
|
| 15 |
+
# Create Generated Clock
|
| 16 |
+
#**************************************************************
|
| 17 |
+
derive_pll_clocks
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
#**************************************************************
|
| 22 |
+
# Set Clock Latency
|
| 23 |
+
#**************************************************************
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
#**************************************************************
|
| 28 |
+
# Set Clock Uncertainty
|
| 29 |
+
#**************************************************************
|
| 30 |
+
derive_clock_uncertainty
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
#**************************************************************
|
| 35 |
+
# Set Input Delay
|
| 36 |
+
#**************************************************************
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
#**************************************************************
|
| 41 |
+
# Set Output Delay
|
| 42 |
+
#**************************************************************
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
#**************************************************************
|
| 47 |
+
# Set Clock Groups
|
| 48 |
+
#**************************************************************
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
#**************************************************************
|
| 53 |
+
# Set False Path
|
| 54 |
+
#**************************************************************
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
#**************************************************************
|
| 59 |
+
# Set Multicycle Path
|
| 60 |
+
#**************************************************************
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
#**************************************************************
|
| 65 |
+
# Set Maximum Delay
|
| 66 |
+
#**************************************************************
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
#**************************************************************
|
| 71 |
+
# Set Minimum Delay
|
| 72 |
+
#**************************************************************
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
#**************************************************************
|
| 77 |
+
# Set Input Transition
|
| 78 |
+
#**************************************************************
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
#**************************************************************
|
| 83 |
+
# Set Load
|
| 84 |
+
#**************************************************************
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
|
MIPSfpga_mipsfpga-plus/boards/de0_nano/de0_nano.v
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module de0_nano
|
| 4 |
+
(
|
| 5 |
+
input CLOCK_50,
|
| 6 |
+
output [ 7:0] LED,
|
| 7 |
+
input [ 1:0] KEY,
|
| 8 |
+
input [ 3:0] SW,
|
| 9 |
+
|
| 10 |
+
`ifdef UNUSED
|
| 11 |
+
|
| 12 |
+
output [12:0] DRAM_ADDR,
|
| 13 |
+
output [ 1:0] DRAM_BA,
|
| 14 |
+
output DRAM_CAS_N,
|
| 15 |
+
output DRAM_CKE,
|
| 16 |
+
output DRAM_CLK,
|
| 17 |
+
output DRAM_CS_N,
|
| 18 |
+
inout [15:0] DRAM_DQ,
|
| 19 |
+
output [ 1:0] DRAM_DQM,
|
| 20 |
+
output DRAM_RAS_N,
|
| 21 |
+
output DRAM_WE_N,
|
| 22 |
+
|
| 23 |
+
output EPCS_ASDO,
|
| 24 |
+
input EPCS_DATA0,
|
| 25 |
+
output EPCS_DCLK,
|
| 26 |
+
output EPCS_NCSO,
|
| 27 |
+
|
| 28 |
+
output G_SENSOR_CS_N,
|
| 29 |
+
input G_SENSOR_INT,
|
| 30 |
+
|
| 31 |
+
output I2C_SCLK,
|
| 32 |
+
inout I2C_SDAT,
|
| 33 |
+
|
| 34 |
+
output ADC_CS_N,
|
| 35 |
+
output ADC_SADDR,
|
| 36 |
+
output ADC_SCLK,
|
| 37 |
+
input ADC_SDAT,
|
| 38 |
+
|
| 39 |
+
inout [12:0] GPIO_2,
|
| 40 |
+
input [ 2:0] GPIO_2_IN,
|
| 41 |
+
|
| 42 |
+
`endif
|
| 43 |
+
|
| 44 |
+
inout [33:0] GPIO_0_D,
|
| 45 |
+
input [ 1:0] GPIO_0_IN
|
| 46 |
+
|
| 47 |
+
`ifdef UNUSED
|
| 48 |
+
|
| 49 |
+
,
|
| 50 |
+
inout [33:0] GPIO_1_D,
|
| 51 |
+
input [ 1:0] GPIO_1_IN
|
| 52 |
+
|
| 53 |
+
`endif
|
| 54 |
+
);
|
| 55 |
+
|
| 56 |
+
wire clk;
|
| 57 |
+
|
| 58 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 59 |
+
|
| 60 |
+
wire muxed_clk;
|
| 61 |
+
wire [1:0] sw_db;
|
| 62 |
+
|
| 63 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 64 |
+
# (.WIDTH (2))
|
| 65 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 66 |
+
(
|
| 67 |
+
.clk ( CLOCK_50 ),
|
| 68 |
+
.sw_in ( SW [1:0] ),
|
| 69 |
+
.sw_out ( sw_db )
|
| 70 |
+
);
|
| 71 |
+
|
| 72 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 73 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 74 |
+
(
|
| 75 |
+
.clki ( CLOCK_50 ),
|
| 76 |
+
.sel_lo ( sw_db [0] ),
|
| 77 |
+
.sel_mid ( sw_db [1] ),
|
| 78 |
+
.clko ( muxed_clk )
|
| 79 |
+
);
|
| 80 |
+
|
| 81 |
+
global gclk
|
| 82 |
+
(
|
| 83 |
+
.in ( muxed_clk ),
|
| 84 |
+
.out ( clk )
|
| 85 |
+
);
|
| 86 |
+
|
| 87 |
+
`else
|
| 88 |
+
|
| 89 |
+
assign clk = CLOCK_50;
|
| 90 |
+
|
| 91 |
+
`endif
|
| 92 |
+
|
| 93 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 94 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 95 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 96 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 97 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 98 |
+
|
| 99 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 4 { 1'b0 } } , SW [3:0] };
|
| 100 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 2 { 1'b0 } } , ~ KEY [1:0] };
|
| 101 |
+
|
| 102 |
+
assign LED = SW [3] ? IO_GreenLEDs [7:0] : IO_RedLEDs [7:0];
|
| 103 |
+
|
| 104 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 105 |
+
wire HWRITE;
|
| 106 |
+
|
| 107 |
+
mfp_system mfp_system
|
| 108 |
+
(
|
| 109 |
+
.SI_ClkIn ( clk ),
|
| 110 |
+
.SI_Reset ( ~ KEY [0] ),
|
| 111 |
+
|
| 112 |
+
.HADDR ( HADDR ),
|
| 113 |
+
.HRDATA ( HRDATA ),
|
| 114 |
+
.HWDATA ( HWDATA ),
|
| 115 |
+
.HWRITE ( HWRITE ),
|
| 116 |
+
|
| 117 |
+
.EJ_TRST_N_probe ( GPIO_0_D [20] ),
|
| 118 |
+
.EJ_TDI ( GPIO_0_D [19] ),
|
| 119 |
+
.EJ_TDO ( GPIO_0_D [17] ),
|
| 120 |
+
.EJ_TMS ( GPIO_0_D [21] ),
|
| 121 |
+
.EJ_TCK ( GPIO_0_D [15] ),
|
| 122 |
+
.SI_ColdReset ( ~ GPIO_0_D [18] ),
|
| 123 |
+
.EJ_DINT ( 1'b0 ),
|
| 124 |
+
|
| 125 |
+
.IO_Switches ( IO_Switches ),
|
| 126 |
+
.IO_Buttons ( IO_Buttons ),
|
| 127 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 128 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 129 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 130 |
+
|
| 131 |
+
.UART_RX ( /* GPIO_0_IN [0] */ GPIO_0_D [29] ),
|
| 132 |
+
.UART_TX ( /* TODO */ ),
|
| 133 |
+
|
| 134 |
+
.SPI_CS ( GPIO_0_D [32] ),
|
| 135 |
+
.SPI_SCK ( GPIO_0_D [26] ),
|
| 136 |
+
.SPI_SDO ( GPIO_0_D [28] )
|
| 137 |
+
);
|
| 138 |
+
|
| 139 |
+
assign GPIO_0_D [13] = 1'b0;
|
| 140 |
+
assign GPIO_0_D [12] = 1'b0;
|
| 141 |
+
assign GPIO_0_D [11] = 1'b1;
|
| 142 |
+
assign GPIO_0_D [10] = 1'b1;
|
| 143 |
+
|
| 144 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/de1/de1.sdc
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**************************************************************
|
| 2 |
+
# Create Clock
|
| 3 |
+
#**************************************************************
|
| 4 |
+
|
| 5 |
+
create_clock -period 20 [get_ports CLOCK_50]
|
| 6 |
+
create_clock -period 37 [get_ports CLOCK_27[1]]
|
| 7 |
+
create_clock -period 40 [get_nets mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz|clko]
|
| 8 |
+
#create_clock -period 40 [get_nets de1|clk]
|
| 9 |
+
create_clock -period 20 [get_ports GPIO_1[17]]
|
| 10 |
+
|
| 11 |
+
#**************************************************************
|
| 12 |
+
# Create Generated Clock
|
| 13 |
+
#**************************************************************
|
| 14 |
+
|
| 15 |
+
derive_pll_clocks
|
| 16 |
+
|
| 17 |
+
#**************************************************************
|
| 18 |
+
# Set Clock Latency
|
| 19 |
+
#**************************************************************
|
| 20 |
+
|
| 21 |
+
#**************************************************************
|
| 22 |
+
# Set Clock Uncertainty
|
| 23 |
+
#**************************************************************
|
| 24 |
+
|
| 25 |
+
derive_clock_uncertainty
|
| 26 |
+
|
| 27 |
+
#**************************************************************
|
| 28 |
+
# Set Input Delay
|
| 29 |
+
#**************************************************************
|
| 30 |
+
|
| 31 |
+
#**************************************************************
|
| 32 |
+
# Set Output Delay
|
| 33 |
+
#**************************************************************
|
| 34 |
+
|
| 35 |
+
#**************************************************************
|
| 36 |
+
# Set Clock Groups
|
| 37 |
+
##**************************************************************
|
| 38 |
+
|
| 39 |
+
#**************************************************************
|
| 40 |
+
# Set False Path
|
| 41 |
+
#**************************************************************
|
| 42 |
+
|
| 43 |
+
#**************************************************************
|
| 44 |
+
# Set Multicycle Path
|
| 45 |
+
#**************************************************************
|
| 46 |
+
|
| 47 |
+
#**************************************************************
|
| 48 |
+
# Set Maximum Delay
|
| 49 |
+
#**************************************************************
|
| 50 |
+
|
| 51 |
+
#**************************************************************
|
| 52 |
+
# Set Minimum Delay
|
| 53 |
+
#**************************************************************
|
| 54 |
+
|
| 55 |
+
#**************************************************************
|
| 56 |
+
# Set Input Transition
|
| 57 |
+
#**************************************************************
|
| 58 |
+
|
| 59 |
+
#**************************************************************
|
| 60 |
+
# Set Load
|
| 61 |
+
#**************************************************************
|
MIPSfpga_mipsfpga-plus/boards/de1/de1.v
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module de1
|
| 4 |
+
(
|
| 5 |
+
input [ 1:0] CLOCK_24,
|
| 6 |
+
input [ 1:0] CLOCK_27,
|
| 7 |
+
input CLOCK_50,
|
| 8 |
+
input EXT_CLOCK,
|
| 9 |
+
|
| 10 |
+
input [ 3:0] KEY,
|
| 11 |
+
|
| 12 |
+
input [ 9:0] SW,
|
| 13 |
+
|
| 14 |
+
output [ 6:0] HEX0,
|
| 15 |
+
output [ 6:0] HEX1,
|
| 16 |
+
output [ 6:0] HEX2,
|
| 17 |
+
output [ 6:0] HEX3,
|
| 18 |
+
|
| 19 |
+
output [ 7:0] LEDG,
|
| 20 |
+
output [ 9:0] LEDR,
|
| 21 |
+
|
| 22 |
+
output UART_TXD,
|
| 23 |
+
input UART_RXD,
|
| 24 |
+
|
| 25 |
+
inout [15:0] DRAM_DQ,
|
| 26 |
+
output [11:0] DRAM_ADDR,
|
| 27 |
+
output DRAM_LDQM,
|
| 28 |
+
output DRAM_UDQM,
|
| 29 |
+
output DRAM_WE_N,
|
| 30 |
+
output DRAM_CAS_N,
|
| 31 |
+
output DRAM_RAS_N,
|
| 32 |
+
output DRAM_CS_N,
|
| 33 |
+
output DRAM_BA_0,
|
| 34 |
+
output DRAM_BA_1,
|
| 35 |
+
output DRAM_CLK,
|
| 36 |
+
output DRAM_CKE,
|
| 37 |
+
|
| 38 |
+
inout [ 7:0] FL_DQ,
|
| 39 |
+
output [21:0] FL_ADDR,
|
| 40 |
+
output FL_WE_N,
|
| 41 |
+
output FL_RST_N,
|
| 42 |
+
output FL_OE_N,
|
| 43 |
+
output FL_CE_N,
|
| 44 |
+
|
| 45 |
+
inout [15:0] SRAM_DQ,
|
| 46 |
+
output [17:0] SRAM_ADDR,
|
| 47 |
+
output SRAM_UB_N,
|
| 48 |
+
output SRAM_LB_N,
|
| 49 |
+
output SRAM_WE_N,
|
| 50 |
+
output SRAM_CE_N,
|
| 51 |
+
output SRAM_OE_N,
|
| 52 |
+
|
| 53 |
+
inout SD_DAT,
|
| 54 |
+
inout SD_DAT3,
|
| 55 |
+
inout SD_CMD,
|
| 56 |
+
output SD_CLK,
|
| 57 |
+
|
| 58 |
+
inout I2C_SDAT,
|
| 59 |
+
output I2C_SCLK,
|
| 60 |
+
|
| 61 |
+
input PS2_DAT,
|
| 62 |
+
input PS2_CLK,
|
| 63 |
+
|
| 64 |
+
input TDI,
|
| 65 |
+
input TCK,
|
| 66 |
+
input TCS,
|
| 67 |
+
output TDO,
|
| 68 |
+
|
| 69 |
+
output VGA_HS,
|
| 70 |
+
output VGA_VS,
|
| 71 |
+
output [ 3:0] VGA_R,
|
| 72 |
+
output [ 3:0] VGA_G,
|
| 73 |
+
output [ 3:0] VGA_B,
|
| 74 |
+
|
| 75 |
+
output AUD_ADCLRCK,
|
| 76 |
+
input AUD_ADCDAT,
|
| 77 |
+
output AUD_DACLRCK,
|
| 78 |
+
output AUD_DACDAT,
|
| 79 |
+
inout AUD_BCLK,
|
| 80 |
+
output AUD_XCK,
|
| 81 |
+
|
| 82 |
+
inout [35:0] GPIO_0,
|
| 83 |
+
inout [35:0] GPIO_1
|
| 84 |
+
);
|
| 85 |
+
|
| 86 |
+
wire clk;
|
| 87 |
+
|
| 88 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 89 |
+
|
| 90 |
+
wire muxed_clk;
|
| 91 |
+
wire [1:0] sw_db;
|
| 92 |
+
|
| 93 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 94 |
+
# (.WIDTH (2))
|
| 95 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 96 |
+
(
|
| 97 |
+
.clk ( CLOCK_50 ),
|
| 98 |
+
.sw_in ( SW [1:0] ),
|
| 99 |
+
.sw_out ( sw_db )
|
| 100 |
+
);
|
| 101 |
+
|
| 102 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 103 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 104 |
+
(
|
| 105 |
+
.clki ( CLOCK_50 ),
|
| 106 |
+
.sel_lo ( sw_db [0] ),
|
| 107 |
+
.sel_mid ( sw_db [1] ),
|
| 108 |
+
.clko ( muxed_clk )
|
| 109 |
+
);
|
| 110 |
+
|
| 111 |
+
global gclk
|
| 112 |
+
(
|
| 113 |
+
.in ( muxed_clk ),
|
| 114 |
+
.out ( clk )
|
| 115 |
+
);
|
| 116 |
+
|
| 117 |
+
`else
|
| 118 |
+
|
| 119 |
+
assign clk = CLOCK_27 [1];
|
| 120 |
+
|
| 121 |
+
`endif
|
| 122 |
+
|
| 123 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 124 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 125 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 126 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 127 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 128 |
+
|
| 129 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 10 { 1'b0 } } , SW [9:0] };
|
| 130 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 4 { 1'b0 } } , ~ KEY [3:0] };
|
| 131 |
+
|
| 132 |
+
assign LEDG = IO_GreenLEDs [7:0];
|
| 133 |
+
assign LEDR = IO_RedLEDs [9:0];
|
| 134 |
+
|
| 135 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 136 |
+
wire HWRITE;
|
| 137 |
+
|
| 138 |
+
mfp_system mfp_system
|
| 139 |
+
(
|
| 140 |
+
.SI_ClkIn ( clk ),
|
| 141 |
+
.SI_Reset ( ~ KEY [0] ),
|
| 142 |
+
|
| 143 |
+
.HADDR ( HADDR ),
|
| 144 |
+
.HRDATA ( HRDATA ),
|
| 145 |
+
.HWDATA ( HWDATA ),
|
| 146 |
+
.HWRITE ( HWRITE ),
|
| 147 |
+
|
| 148 |
+
.EJ_TRST_N_probe ( GPIO_1 [22] ),
|
| 149 |
+
.EJ_TDI ( GPIO_1 [21] ),
|
| 150 |
+
.EJ_TDO ( GPIO_1 [19] ),
|
| 151 |
+
.EJ_TMS ( GPIO_1 [23] ),
|
| 152 |
+
.EJ_TCK ( GPIO_1 [17] ),
|
| 153 |
+
.SI_ColdReset ( ~ GPIO_1 [20] ),
|
| 154 |
+
.EJ_DINT ( 1'b0 ),
|
| 155 |
+
|
| 156 |
+
.IO_Switches ( IO_Switches ),
|
| 157 |
+
.IO_Buttons ( IO_Buttons ),
|
| 158 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 159 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 160 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 161 |
+
|
| 162 |
+
.UART_RX ( GPIO_1 [31] ),
|
| 163 |
+
.UART_TX ( /* TODO */ ),
|
| 164 |
+
|
| 165 |
+
.SPI_CS ( GPIO_1 [34] ),
|
| 166 |
+
.SPI_SCK ( GPIO_1 [28] ),
|
| 167 |
+
.SPI_SDO ( GPIO_1 [30] )
|
| 168 |
+
);
|
| 169 |
+
|
| 170 |
+
assign GPIO_1 [15] = 1'b0;
|
| 171 |
+
assign GPIO_1 [14] = 1'b0;
|
| 172 |
+
assign GPIO_1 [13] = 1'b1;
|
| 173 |
+
assign GPIO_1 [12] = 1'b1;
|
| 174 |
+
|
| 175 |
+
assign GPIO_1 [26] = 1'b0;
|
| 176 |
+
|
| 177 |
+
mfp_single_digit_seven_segment_display digit_3 ( IO_7_SegmentHEX [15:12] , HEX3 );
|
| 178 |
+
mfp_single_digit_seven_segment_display digit_2 ( IO_7_SegmentHEX [11: 8] , HEX2 );
|
| 179 |
+
mfp_single_digit_seven_segment_display digit_1 ( IO_7_SegmentHEX [ 7: 4] , HEX1 );
|
| 180 |
+
mfp_single_digit_seven_segment_display digit_0 ( IO_7_SegmentHEX [ 3: 0] , HEX0 );
|
| 181 |
+
|
| 182 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/de10_lite/board_config.vh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//board specific settings
|
| 2 |
+
|
| 3 |
+
//SDRAM parameters for 64MB (Terasic DE10-Lite)
|
| 4 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 5 |
+
`define SDRAM_ADDR_BITS 13
|
| 6 |
+
`define SDRAM_ROW_BITS 13
|
| 7 |
+
`define SDRAM_COL_BITS 10
|
| 8 |
+
`define SDRAM_DQ_BITS 16
|
| 9 |
+
`define SDRAM_BA_BITS 2
|
| 10 |
+
`define SDRAM_DM_BITS 2
|
| 11 |
+
`define MFP_RAM_ADDR_WIDTH (`SDRAM_ROW_BITS + `SDRAM_COL_BITS + `SDRAM_BA_BITS)
|
| 12 |
+
|
| 13 |
+
//values for fclk=50 MHz
|
| 14 |
+
`define SDRAM_DELAY_nCKE 10000
|
| 15 |
+
`define SDRAM_DELAY_tREF 360
|
| 16 |
+
`define SDRAM_DELAY_tRP 0
|
| 17 |
+
`define SDRAM_DELAY_tRFC 2
|
| 18 |
+
`define SDRAM_DELAY_tMRD 0
|
| 19 |
+
`define SDRAM_DELAY_tRCD 0
|
| 20 |
+
`define SDRAM_DELAY_tCAS 0
|
| 21 |
+
`define SDRAM_DELAY_afterREAD 0
|
| 22 |
+
`define SDRAM_DELAY_afterWRITE 2
|
| 23 |
+
`define SDRAM_COUNT_initAutoRef 8
|
| 24 |
+
`endif
|
MIPSfpga_mipsfpga-plus/boards/de10_lite/de10_lite.sdc
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**************************************************************
|
| 2 |
+
# Create Clock
|
| 3 |
+
#**************************************************************
|
| 4 |
+
create_clock -period "10.0 MHz" [get_ports ADC_CLK_10]
|
| 5 |
+
create_clock -period "50.0 MHz" [get_ports MAX10_CLK1_50]
|
| 6 |
+
create_clock -period "50.0 MHz" [get_ports MAX10_CLK2_50]
|
| 7 |
+
create_clock -period 40 [get_nets mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz|clko]
|
| 8 |
+
create_clock -period 20 [get_nets de10_lite|clk]
|
| 9 |
+
create_clock -period 20 [get_ports GPIO[17]]
|
| 10 |
+
|
| 11 |
+
#**************************************************************
|
| 12 |
+
# Create Generated Clock
|
| 13 |
+
#**************************************************************
|
| 14 |
+
derive_pll_clocks
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
#**************************************************************
|
| 19 |
+
# Set Clock Latency
|
| 20 |
+
#**************************************************************
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
#**************************************************************
|
| 25 |
+
# Set Clock Uncertainty
|
| 26 |
+
#**************************************************************
|
| 27 |
+
derive_clock_uncertainty
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
#**************************************************************
|
| 32 |
+
# Set Input Delay
|
| 33 |
+
#**************************************************************
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
#**************************************************************
|
| 38 |
+
# Set Output Delay
|
| 39 |
+
#**************************************************************
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
#**************************************************************
|
| 44 |
+
# Set Clock Groups
|
| 45 |
+
#**************************************************************
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
#**************************************************************
|
| 50 |
+
# Set False Path
|
| 51 |
+
#**************************************************************
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
#**************************************************************
|
| 56 |
+
# Set Multicycle Path
|
| 57 |
+
#**************************************************************
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
#**************************************************************
|
| 62 |
+
# Set Maximum Delay
|
| 63 |
+
#**************************************************************
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
#**************************************************************
|
| 68 |
+
# Set Minimum Delay
|
| 69 |
+
#**************************************************************
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
#**************************************************************
|
| 74 |
+
# Set Input Transition
|
| 75 |
+
#**************************************************************
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
#**************************************************************
|
| 80 |
+
# Set Load
|
| 81 |
+
#**************************************************************
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
MIPSfpga_mipsfpga-plus/boards/de10_lite/de10_lite.v
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module de10_lite
|
| 4 |
+
(
|
| 5 |
+
input ADC_CLK_10,
|
| 6 |
+
input MAX10_CLK1_50,
|
| 7 |
+
input MAX10_CLK2_50,
|
| 8 |
+
|
| 9 |
+
input [ 1:0] KEY,
|
| 10 |
+
input [ 9:0] SW,
|
| 11 |
+
output [ 7:0] HEX0,
|
| 12 |
+
output [ 7:0] HEX1,
|
| 13 |
+
output [ 7:0] HEX2,
|
| 14 |
+
output [ 7:0] HEX3,
|
| 15 |
+
output [ 7:0] HEX4,
|
| 16 |
+
output [ 7:0] HEX5,
|
| 17 |
+
output [ 9:0] LEDR,
|
| 18 |
+
|
| 19 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 20 |
+
output [12:0] DRAM_ADDR,
|
| 21 |
+
output [ 1:0] DRAM_BA,
|
| 22 |
+
output DRAM_CAS_N,
|
| 23 |
+
output DRAM_CKE,
|
| 24 |
+
output DRAM_CLK,
|
| 25 |
+
output DRAM_CS_N,
|
| 26 |
+
inout [15:0] DRAM_DQ,
|
| 27 |
+
output DRAM_LDQM,
|
| 28 |
+
output DRAM_RAS_N,
|
| 29 |
+
output DRAM_UDQM,
|
| 30 |
+
output DRAM_WE_N,
|
| 31 |
+
`endif
|
| 32 |
+
|
| 33 |
+
`ifdef UNUSED
|
| 34 |
+
output [ 3:0] VGA_B,
|
| 35 |
+
output [ 3:0] VGA_G,
|
| 36 |
+
output VGA_HS,
|
| 37 |
+
output [ 3:0] VGA_R,
|
| 38 |
+
output VGA_VS,
|
| 39 |
+
output GSENSOR_CS_N,
|
| 40 |
+
input [ 2:1] GSENSOR_INT,
|
| 41 |
+
output GSENSOR_SCLK,
|
| 42 |
+
inout GSENSOR_SDI,
|
| 43 |
+
inout GSENSOR_SDO,
|
| 44 |
+
inout [15:0] ARDUINO_IO,
|
| 45 |
+
inout ARDUINO_RESET_N,
|
| 46 |
+
`endif
|
| 47 |
+
|
| 48 |
+
inout [35:0] GPIO
|
| 49 |
+
);
|
| 50 |
+
|
| 51 |
+
// global clock signals
|
| 52 |
+
wire clk;
|
| 53 |
+
wire ADC_CLK;
|
| 54 |
+
wire clk200; //for phase shift debug with logic analyser
|
| 55 |
+
|
| 56 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 57 |
+
wire CLK_Lock;
|
| 58 |
+
pll pll(MAX10_CLK1_50, ADC_CLK, clk, DRAM_CLK, clk200, CLK_Lock);
|
| 59 |
+
|
| 60 |
+
`elsif MFP_USE_ADC_MAX10
|
| 61 |
+
wire CLK_Lock;
|
| 62 |
+
pll pll(MAX10_CLK1_50, ADC_CLK, clk, DRAM_CLK, clk200, CLK_Lock);
|
| 63 |
+
|
| 64 |
+
`elsif MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 65 |
+
|
| 66 |
+
wire CLK_Lock = 1'b1;
|
| 67 |
+
wire muxed_clk;
|
| 68 |
+
wire [1:0] sw_db;
|
| 69 |
+
|
| 70 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 71 |
+
# (.WIDTH (2))
|
| 72 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 73 |
+
(
|
| 74 |
+
.clk ( MAX10_CLK1_50 ),
|
| 75 |
+
.sw_in ( SW [1:0] ),
|
| 76 |
+
.sw_out ( sw_db )
|
| 77 |
+
);
|
| 78 |
+
|
| 79 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 80 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 81 |
+
(
|
| 82 |
+
.clki ( MAX10_CLK1_50 ),
|
| 83 |
+
.sel_lo ( sw_db [0] ),
|
| 84 |
+
.sel_mid ( sw_db [1] ),
|
| 85 |
+
.clko ( muxed_clk )
|
| 86 |
+
);
|
| 87 |
+
|
| 88 |
+
global gclk
|
| 89 |
+
(
|
| 90 |
+
.in ( muxed_clk ),
|
| 91 |
+
.out ( clk )
|
| 92 |
+
);
|
| 93 |
+
|
| 94 |
+
`else
|
| 95 |
+
wire CLK_Lock = 1'b1;
|
| 96 |
+
assign clk = MAX10_CLK1_50;
|
| 97 |
+
`endif
|
| 98 |
+
|
| 99 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 100 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 101 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 102 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 103 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 104 |
+
|
| 105 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 10 { 1'b0 } } , SW [9:0] };
|
| 106 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 2 { 1'b0 } } , ~ KEY [1:0] };
|
| 107 |
+
|
| 108 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 109 |
+
wire HWRITE;
|
| 110 |
+
|
| 111 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 112 |
+
assign LEDR[9] = ~DRAM_CKE;
|
| 113 |
+
assign LEDR[8:0] = IO_RedLEDs [8:0];
|
| 114 |
+
`elsif MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 115 |
+
assign LEDR = (sw_db == 2'b00 ? IO_RedLEDs [9:0] : IO_GreenLEDs [9:0]);
|
| 116 |
+
`else
|
| 117 |
+
assign LEDR = IO_RedLEDs [9:0];
|
| 118 |
+
`endif
|
| 119 |
+
|
| 120 |
+
`ifdef MFP_USE_ADC_MAX10
|
| 121 |
+
wire ADC_C_Valid;
|
| 122 |
+
wire [ 4:0 ] ADC_C_Channel;
|
| 123 |
+
wire ADC_C_SOP;
|
| 124 |
+
wire ADC_C_EOP;
|
| 125 |
+
wire ADC_C_Ready;
|
| 126 |
+
wire ADC_R_Valid;
|
| 127 |
+
wire [ 4:0 ] ADC_R_Channel;
|
| 128 |
+
wire [ 11:0 ] ADC_R_Data;
|
| 129 |
+
wire ADC_R_SOP;
|
| 130 |
+
wire ADC_R_EOP;
|
| 131 |
+
`endif
|
| 132 |
+
|
| 133 |
+
`define MFP_EJTAG_DEBUGGER
|
| 134 |
+
`ifdef MFP_EJTAG_DEBUGGER
|
| 135 |
+
// MIPSfpga EJTAG BusBluster 3 connector pinout
|
| 136 |
+
// EJTAG DIRECTION PIN CONN PIN DIRECTION EJTAG
|
| 137 |
+
// ===== ========= ======== ========= ======== ========= ======
|
| 138 |
+
// VCC output GPIO[12] 15 | 16 GPIO[13] output VCC
|
| 139 |
+
// GND output GPIO[14] 17 | 18 GPIO[15] output GND
|
| 140 |
+
// NC output GPIO[16] 19 | 20 GPIO[17] input EJ_TCK
|
| 141 |
+
// NC output GPIO[18] 21 | 22 GPIO[19] output EJ_TDO
|
| 142 |
+
// EJ_RST input GPIO[20] 23 | 24 GPIO[21] input EJ_TDI
|
| 143 |
+
// EJ_TRST input GPIO[22] 25 | 26 GPIO[23] input EJ_TMS
|
| 144 |
+
|
| 145 |
+
wire EJ_VCC = 1'b1;
|
| 146 |
+
wire EJ_GND = 1'b0;
|
| 147 |
+
wire EJ_NC = 1'bz;
|
| 148 |
+
wire EJ_TCK = GPIO[17];
|
| 149 |
+
wire EJ_RST = GPIO[20];
|
| 150 |
+
wire EJ_TDI = GPIO[21];
|
| 151 |
+
wire EJ_TRST = GPIO[22];
|
| 152 |
+
wire EJ_TMS = GPIO[23];
|
| 153 |
+
wire EJ_DINT = 1'b0;
|
| 154 |
+
wire EJ_TDO;
|
| 155 |
+
|
| 156 |
+
assign GPIO[12] = EJ_VCC;
|
| 157 |
+
assign GPIO[13] = EJ_VCC;
|
| 158 |
+
assign GPIO[14] = EJ_GND;
|
| 159 |
+
assign GPIO[15] = EJ_GND;
|
| 160 |
+
assign GPIO[16] = EJ_NC;
|
| 161 |
+
assign GPIO[18] = EJ_NC;
|
| 162 |
+
assign GPIO[19] = EJ_TDO;
|
| 163 |
+
`endif
|
| 164 |
+
|
| 165 |
+
`ifdef MFP_DEMO_LIGHT_SENSOR
|
| 166 |
+
// ALS CONN PIN DIRECTION
|
| 167 |
+
// ===== ====== ===== =============
|
| 168 |
+
// VCC 29 3.3V
|
| 169 |
+
// GND 31 GPIO[26] output
|
| 170 |
+
// SCK 33 GPIO[28] output
|
| 171 |
+
// SDO 35 GPIO[30] input
|
| 172 |
+
// NC 37 GPIO[32] not connected
|
| 173 |
+
// CS 39 GPIO[34] output
|
| 174 |
+
|
| 175 |
+
wire ALS_GND = 1'b0;
|
| 176 |
+
wire ALS_SCK;
|
| 177 |
+
wire ALS_SDO;
|
| 178 |
+
wire ALS_NC = 1'bz;
|
| 179 |
+
wire ALS_CS;
|
| 180 |
+
|
| 181 |
+
assign GPIO[26] = ALS_GND;
|
| 182 |
+
assign GPIO[28] = ALS_SCK;
|
| 183 |
+
assign ALS_SDO = GPIO[30];
|
| 184 |
+
assign GPIO[32] = ALS_NC;
|
| 185 |
+
assign GPIO[34] = ALS_CS;
|
| 186 |
+
`endif
|
| 187 |
+
|
| 188 |
+
//This is a workaround to make EJTAG working
|
| 189 |
+
//TODO: add complex reset signals handling module
|
| 190 |
+
wire RESETn = KEY [0] & GPIO [20] & CLK_Lock;
|
| 191 |
+
|
| 192 |
+
mfp_system mfp_system
|
| 193 |
+
(
|
| 194 |
+
.SI_ClkIn ( clk ),
|
| 195 |
+
.SI_Reset ( ~RESETn ),
|
| 196 |
+
|
| 197 |
+
.HADDR ( HADDR ),
|
| 198 |
+
.HRDATA ( HRDATA ),
|
| 199 |
+
.HWDATA ( HWDATA ),
|
| 200 |
+
.HWRITE ( HWRITE ),
|
| 201 |
+
|
| 202 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 203 |
+
.SDRAM_CKE ( DRAM_CKE ),
|
| 204 |
+
.SDRAM_CSn ( DRAM_CS_N ),
|
| 205 |
+
.SDRAM_RASn ( DRAM_RAS_N ),
|
| 206 |
+
.SDRAM_CASn ( DRAM_CAS_N ),
|
| 207 |
+
.SDRAM_WEn ( DRAM_WE_N ),
|
| 208 |
+
.SDRAM_ADDR ( DRAM_ADDR ),
|
| 209 |
+
.SDRAM_BA ( DRAM_BA ),
|
| 210 |
+
.SDRAM_DQ ( DRAM_DQ ),
|
| 211 |
+
.SDRAM_DQM ( {DRAM_UDQM, DRAM_LDQM} ),
|
| 212 |
+
`endif
|
| 213 |
+
|
| 214 |
+
`ifdef MFP_EJTAG_DEBUGGER
|
| 215 |
+
.EJ_TRST_N_probe ( EJ_TRST ),
|
| 216 |
+
.EJ_TDI ( EJ_TDI ),
|
| 217 |
+
.EJ_TDO ( EJ_TDO ),
|
| 218 |
+
.EJ_TMS ( EJ_TMS ),
|
| 219 |
+
.EJ_TCK ( EJ_TCK ),
|
| 220 |
+
.SI_ColdReset ( ~ EJ_RST ),
|
| 221 |
+
.EJ_DINT ( EJ_DINT ),
|
| 222 |
+
`endif
|
| 223 |
+
|
| 224 |
+
.IO_Switches ( IO_Switches ),
|
| 225 |
+
.IO_Buttons ( IO_Buttons ),
|
| 226 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 227 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 228 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 229 |
+
|
| 230 |
+
`ifdef MFP_USE_DUPLEX_UART
|
| 231 |
+
.UART_SRX ( GPIO [33] ),
|
| 232 |
+
.UART_STX ( GPIO [35] ),
|
| 233 |
+
`endif
|
| 234 |
+
|
| 235 |
+
`ifdef MFP_DEMO_LIGHT_SENSOR
|
| 236 |
+
.SPI_CS ( ALS_CS ),
|
| 237 |
+
.SPI_SCK ( ALS_SCK ),
|
| 238 |
+
.SPI_SDO ( ALS_SDO ),
|
| 239 |
+
`endif
|
| 240 |
+
|
| 241 |
+
`ifdef MFP_USE_ADC_MAX10
|
| 242 |
+
.ADC_C_Valid ( ADC_C_Valid ),
|
| 243 |
+
.ADC_C_Channel ( ADC_C_Channel ),
|
| 244 |
+
.ADC_C_SOP ( ADC_C_SOP ),
|
| 245 |
+
.ADC_C_EOP ( ADC_C_EOP ),
|
| 246 |
+
.ADC_C_Ready ( ADC_C_Ready ),
|
| 247 |
+
.ADC_R_Valid ( ADC_R_Valid ),
|
| 248 |
+
.ADC_R_Channel ( ADC_R_Channel ),
|
| 249 |
+
.ADC_R_Data ( ADC_R_Data ),
|
| 250 |
+
.ADC_R_SOP ( ADC_R_SOP ),
|
| 251 |
+
.ADC_R_EOP ( ADC_R_EOP ),
|
| 252 |
+
`endif
|
| 253 |
+
|
| 254 |
+
.UART_RX ( GPIO [31] ),
|
| 255 |
+
.UART_TX ( GPIO [32] )
|
| 256 |
+
);
|
| 257 |
+
|
| 258 |
+
`ifdef MFP_USE_ADC_MAX10
|
| 259 |
+
adc adc
|
| 260 |
+
(
|
| 261 |
+
.adc_pll_clock_clk ( ADC_CLK ),
|
| 262 |
+
.adc_pll_locked_export ( CLK_Lock ),
|
| 263 |
+
.clock_clk ( clk ),
|
| 264 |
+
.command_valid ( ADC_C_Valid ),
|
| 265 |
+
.command_channel ( ADC_C_Channel ),
|
| 266 |
+
.command_startofpacket ( ADC_C_SOP ),
|
| 267 |
+
.command_endofpacket ( ADC_C_EOP ),
|
| 268 |
+
.command_ready ( ADC_C_Ready ),
|
| 269 |
+
.reset_sink_reset_n ( RESETn ),
|
| 270 |
+
.response_valid ( ADC_R_Valid ),
|
| 271 |
+
.response_channel ( ADC_R_Channel ),
|
| 272 |
+
.response_data ( ADC_R_Data ),
|
| 273 |
+
.response_startofpacket ( ADC_R_SOP ),
|
| 274 |
+
.response_endofpacket ( ADC_R_EOP )
|
| 275 |
+
);
|
| 276 |
+
`endif
|
| 277 |
+
|
| 278 |
+
`ifdef MFP_USE_SDRAM_MEMORY
|
| 279 |
+
//SDRAM controller delay params
|
| 280 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_nCKE = `SDRAM_DELAY_nCKE;
|
| 281 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tREF = `SDRAM_DELAY_tREF;
|
| 282 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tRP = `SDRAM_DELAY_tRP;
|
| 283 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tRFC = `SDRAM_DELAY_tRFC;
|
| 284 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tMRD = `SDRAM_DELAY_tMRD;
|
| 285 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tRCD = `SDRAM_DELAY_tRCD;
|
| 286 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_tCAS = `SDRAM_DELAY_tCAS;
|
| 287 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_afterREAD = `SDRAM_DELAY_afterREAD;
|
| 288 |
+
defparam mfp_system.matrix_loader.matrix.ram.DELAY_afterWRITE = `SDRAM_DELAY_afterWRITE;
|
| 289 |
+
defparam mfp_system.matrix_loader.matrix.ram.COUNT_initAutoRef = `SDRAM_COUNT_initAutoRef;
|
| 290 |
+
`endif
|
| 291 |
+
|
| 292 |
+
assign HEX0 [ 7] = 1'b1;
|
| 293 |
+
assign HEX1 [ 7] = 1'b1;
|
| 294 |
+
assign HEX2 [ 7] = 1'b1;
|
| 295 |
+
assign HEX3 [ 7] = 1'b1;
|
| 296 |
+
assign HEX4 [ 7] = 1'b1;
|
| 297 |
+
assign HEX5 [ 7] = 1'b1;
|
| 298 |
+
|
| 299 |
+
mfp_single_digit_seven_segment_display digit_5 ( IO_7_SegmentHEX [23:20] , HEX5 [6:0] );
|
| 300 |
+
mfp_single_digit_seven_segment_display digit_4 ( IO_7_SegmentHEX [19:16] , HEX4 [6:0] );
|
| 301 |
+
mfp_single_digit_seven_segment_display digit_3 ( IO_7_SegmentHEX [15:12] , HEX3 [6:0] );
|
| 302 |
+
mfp_single_digit_seven_segment_display digit_2 ( IO_7_SegmentHEX [11: 8] , HEX2 [6:0] );
|
| 303 |
+
mfp_single_digit_seven_segment_display digit_1 ( IO_7_SegmentHEX [ 7: 4] , HEX1 [6:0] );
|
| 304 |
+
mfp_single_digit_seven_segment_display digit_0 ( IO_7_SegmentHEX [ 3: 0] , HEX0 [6:0] );
|
| 305 |
+
|
| 306 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/de10_lite/pll.v
ADDED
|
@@ -0,0 +1,395 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// megafunction wizard: %ALTPLL%
|
| 2 |
+
// GENERATION: STANDARD
|
| 3 |
+
// VERSION: WM1.0
|
| 4 |
+
// MODULE: altpll
|
| 5 |
+
|
| 6 |
+
// ============================================================
|
| 7 |
+
// File Name: pll.v
|
| 8 |
+
// Megafunction Name(s):
|
| 9 |
+
// altpll
|
| 10 |
+
//
|
| 11 |
+
// Simulation Library Files(s):
|
| 12 |
+
// altera_mf
|
| 13 |
+
// ============================================================
|
| 14 |
+
// ************************************************************
|
| 15 |
+
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
|
| 16 |
+
//
|
| 17 |
+
// 16.1.0 Build 196 10/24/2016 SJ Lite Edition
|
| 18 |
+
// ************************************************************
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
//Copyright (C) 2016 Intel Corporation. All rights reserved.
|
| 22 |
+
//Your use of Intel Corporation's design tools, logic functions
|
| 23 |
+
//and other software and tools, and its AMPP partner logic
|
| 24 |
+
//functions, and any output files from any of the foregoing
|
| 25 |
+
//(including device programming or simulation files), and any
|
| 26 |
+
//associated documentation or information are expressly subject
|
| 27 |
+
//to the terms and conditions of the Intel Program License
|
| 28 |
+
//Subscription Agreement, the Intel Quartus Prime License Agreement,
|
| 29 |
+
//the Intel MegaCore Function License Agreement, or other
|
| 30 |
+
//applicable license agreement, including, without limitation,
|
| 31 |
+
//that your use is for the sole purpose of programming logic
|
| 32 |
+
//devices manufactured by Intel and sold by Intel or its
|
| 33 |
+
//authorized distributors. Please refer to the applicable
|
| 34 |
+
//agreement for further details.
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
// synopsys translate_off
|
| 38 |
+
`timescale 1 ps / 1 ps
|
| 39 |
+
// synopsys translate_on
|
| 40 |
+
module pll (
|
| 41 |
+
inclk0,
|
| 42 |
+
c0,
|
| 43 |
+
c1,
|
| 44 |
+
c2,
|
| 45 |
+
c3,
|
| 46 |
+
locked);
|
| 47 |
+
|
| 48 |
+
input inclk0;
|
| 49 |
+
output c0;
|
| 50 |
+
output c1;
|
| 51 |
+
output c2;
|
| 52 |
+
output c3;
|
| 53 |
+
output locked;
|
| 54 |
+
|
| 55 |
+
wire [0:0] sub_wire2 = 1'h0;
|
| 56 |
+
wire [4:0] sub_wire3;
|
| 57 |
+
wire sub_wire8;
|
| 58 |
+
wire sub_wire0 = inclk0;
|
| 59 |
+
wire [1:0] sub_wire1 = {sub_wire2, sub_wire0};
|
| 60 |
+
wire [3:3] sub_wire7 = sub_wire3[3:3];
|
| 61 |
+
wire [2:2] sub_wire6 = sub_wire3[2:2];
|
| 62 |
+
wire [1:1] sub_wire5 = sub_wire3[1:1];
|
| 63 |
+
wire [0:0] sub_wire4 = sub_wire3[0:0];
|
| 64 |
+
wire c0 = sub_wire4;
|
| 65 |
+
wire c1 = sub_wire5;
|
| 66 |
+
wire c2 = sub_wire6;
|
| 67 |
+
wire c3 = sub_wire7;
|
| 68 |
+
wire locked = sub_wire8;
|
| 69 |
+
|
| 70 |
+
altpll altpll_component (
|
| 71 |
+
.inclk (sub_wire1),
|
| 72 |
+
.clk (sub_wire3),
|
| 73 |
+
.locked (sub_wire8),
|
| 74 |
+
.activeclock (),
|
| 75 |
+
.areset (1'b0),
|
| 76 |
+
.clkbad (),
|
| 77 |
+
.clkena ({6{1'b1}}),
|
| 78 |
+
.clkloss (),
|
| 79 |
+
.clkswitch (1'b0),
|
| 80 |
+
.configupdate (1'b0),
|
| 81 |
+
.enable0 (),
|
| 82 |
+
.enable1 (),
|
| 83 |
+
.extclk (),
|
| 84 |
+
.extclkena ({4{1'b1}}),
|
| 85 |
+
.fbin (1'b1),
|
| 86 |
+
.fbmimicbidir (),
|
| 87 |
+
.fbout (),
|
| 88 |
+
.fref (),
|
| 89 |
+
.icdrclk (),
|
| 90 |
+
.pfdena (1'b1),
|
| 91 |
+
.phasecounterselect ({4{1'b1}}),
|
| 92 |
+
.phasedone (),
|
| 93 |
+
.phasestep (1'b1),
|
| 94 |
+
.phaseupdown (1'b1),
|
| 95 |
+
.pllena (1'b1),
|
| 96 |
+
.scanaclr (1'b0),
|
| 97 |
+
.scanclk (1'b0),
|
| 98 |
+
.scanclkena (1'b1),
|
| 99 |
+
.scandata (1'b0),
|
| 100 |
+
.scandataout (),
|
| 101 |
+
.scandone (),
|
| 102 |
+
.scanread (1'b0),
|
| 103 |
+
.scanwrite (1'b0),
|
| 104 |
+
.sclkout0 (),
|
| 105 |
+
.sclkout1 (),
|
| 106 |
+
.vcooverrange (),
|
| 107 |
+
.vcounderrange ());
|
| 108 |
+
defparam
|
| 109 |
+
altpll_component.bandwidth_type = "AUTO",
|
| 110 |
+
altpll_component.clk0_divide_by = 5,
|
| 111 |
+
altpll_component.clk0_duty_cycle = 50,
|
| 112 |
+
altpll_component.clk0_multiply_by = 1,
|
| 113 |
+
altpll_component.clk0_phase_shift = "0",
|
| 114 |
+
altpll_component.clk1_divide_by = 1,
|
| 115 |
+
altpll_component.clk1_duty_cycle = 50,
|
| 116 |
+
altpll_component.clk1_multiply_by = 1,
|
| 117 |
+
altpll_component.clk1_phase_shift = "0",
|
| 118 |
+
altpll_component.clk2_divide_by = 1,
|
| 119 |
+
altpll_component.clk2_duty_cycle = 50,
|
| 120 |
+
altpll_component.clk2_multiply_by = 1,
|
| 121 |
+
altpll_component.clk2_phase_shift = "-12000",
|
| 122 |
+
altpll_component.clk3_divide_by = 1,
|
| 123 |
+
altpll_component.clk3_duty_cycle = 50,
|
| 124 |
+
altpll_component.clk3_multiply_by = 4,
|
| 125 |
+
altpll_component.clk3_phase_shift = "-833",
|
| 126 |
+
altpll_component.compensate_clock = "CLK0",
|
| 127 |
+
altpll_component.inclk0_input_frequency = 20000,
|
| 128 |
+
altpll_component.intended_device_family = "MAX 10",
|
| 129 |
+
altpll_component.lpm_hint = "CBX_MODULE_PREFIX=pll",
|
| 130 |
+
altpll_component.lpm_type = "altpll",
|
| 131 |
+
altpll_component.operation_mode = "NORMAL",
|
| 132 |
+
altpll_component.pll_type = "AUTO",
|
| 133 |
+
altpll_component.port_activeclock = "PORT_UNUSED",
|
| 134 |
+
altpll_component.port_areset = "PORT_UNUSED",
|
| 135 |
+
altpll_component.port_clkbad0 = "PORT_UNUSED",
|
| 136 |
+
altpll_component.port_clkbad1 = "PORT_UNUSED",
|
| 137 |
+
altpll_component.port_clkloss = "PORT_UNUSED",
|
| 138 |
+
altpll_component.port_clkswitch = "PORT_UNUSED",
|
| 139 |
+
altpll_component.port_configupdate = "PORT_UNUSED",
|
| 140 |
+
altpll_component.port_fbin = "PORT_UNUSED",
|
| 141 |
+
altpll_component.port_inclk0 = "PORT_USED",
|
| 142 |
+
altpll_component.port_inclk1 = "PORT_UNUSED",
|
| 143 |
+
altpll_component.port_locked = "PORT_USED",
|
| 144 |
+
altpll_component.port_pfdena = "PORT_UNUSED",
|
| 145 |
+
altpll_component.port_phasecounterselect = "PORT_UNUSED",
|
| 146 |
+
altpll_component.port_phasedone = "PORT_UNUSED",
|
| 147 |
+
altpll_component.port_phasestep = "PORT_UNUSED",
|
| 148 |
+
altpll_component.port_phaseupdown = "PORT_UNUSED",
|
| 149 |
+
altpll_component.port_pllena = "PORT_UNUSED",
|
| 150 |
+
altpll_component.port_scanaclr = "PORT_UNUSED",
|
| 151 |
+
altpll_component.port_scanclk = "PORT_UNUSED",
|
| 152 |
+
altpll_component.port_scanclkena = "PORT_UNUSED",
|
| 153 |
+
altpll_component.port_scandata = "PORT_UNUSED",
|
| 154 |
+
altpll_component.port_scandataout = "PORT_UNUSED",
|
| 155 |
+
altpll_component.port_scandone = "PORT_UNUSED",
|
| 156 |
+
altpll_component.port_scanread = "PORT_UNUSED",
|
| 157 |
+
altpll_component.port_scanwrite = "PORT_UNUSED",
|
| 158 |
+
altpll_component.port_clk0 = "PORT_USED",
|
| 159 |
+
altpll_component.port_clk1 = "PORT_USED",
|
| 160 |
+
altpll_component.port_clk2 = "PORT_USED",
|
| 161 |
+
altpll_component.port_clk3 = "PORT_USED",
|
| 162 |
+
altpll_component.port_clk4 = "PORT_UNUSED",
|
| 163 |
+
altpll_component.port_clk5 = "PORT_UNUSED",
|
| 164 |
+
altpll_component.port_clkena0 = "PORT_UNUSED",
|
| 165 |
+
altpll_component.port_clkena1 = "PORT_UNUSED",
|
| 166 |
+
altpll_component.port_clkena2 = "PORT_UNUSED",
|
| 167 |
+
altpll_component.port_clkena3 = "PORT_UNUSED",
|
| 168 |
+
altpll_component.port_clkena4 = "PORT_UNUSED",
|
| 169 |
+
altpll_component.port_clkena5 = "PORT_UNUSED",
|
| 170 |
+
altpll_component.port_extclk0 = "PORT_UNUSED",
|
| 171 |
+
altpll_component.port_extclk1 = "PORT_UNUSED",
|
| 172 |
+
altpll_component.port_extclk2 = "PORT_UNUSED",
|
| 173 |
+
altpll_component.port_extclk3 = "PORT_UNUSED",
|
| 174 |
+
altpll_component.self_reset_on_loss_lock = "OFF",
|
| 175 |
+
altpll_component.width_clock = 5;
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
endmodule
|
| 179 |
+
|
| 180 |
+
// ============================================================
|
| 181 |
+
// CNX file retrieval info
|
| 182 |
+
// ============================================================
|
| 183 |
+
// Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
|
| 184 |
+
// Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
|
| 185 |
+
// Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "1"
|
| 186 |
+
// Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
|
| 187 |
+
// Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
|
| 188 |
+
// Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
|
| 189 |
+
// Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
|
| 190 |
+
// Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
|
| 191 |
+
// Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
|
| 192 |
+
// Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
|
| 193 |
+
// Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
|
| 194 |
+
// Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
|
| 195 |
+
// Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
|
| 196 |
+
// Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
|
| 197 |
+
// Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "c0"
|
| 198 |
+
// Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "Any"
|
| 199 |
+
// Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "5"
|
| 200 |
+
// Retrieval info: PRIVATE: DIV_FACTOR1 NUMERIC "1"
|
| 201 |
+
// Retrieval info: PRIVATE: DIV_FACTOR2 NUMERIC "1"
|
| 202 |
+
// Retrieval info: PRIVATE: DIV_FACTOR3 NUMERIC "1"
|
| 203 |
+
// Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
|
| 204 |
+
// Retrieval info: PRIVATE: DUTY_CYCLE1 STRING "50.00000000"
|
| 205 |
+
// Retrieval info: PRIVATE: DUTY_CYCLE2 STRING "50.00000000"
|
| 206 |
+
// Retrieval info: PRIVATE: DUTY_CYCLE3 STRING "50.00000000"
|
| 207 |
+
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "10.000000"
|
| 208 |
+
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE1 STRING "50.000000"
|
| 209 |
+
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE2 STRING "50.000000"
|
| 210 |
+
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE3 STRING "200.000000"
|
| 211 |
+
// Retrieval info: PRIVATE: EXPLICIT_SWITCHOVER_COUNTER STRING "0"
|
| 212 |
+
// Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
|
| 213 |
+
// Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
|
| 214 |
+
// Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
|
| 215 |
+
// Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
|
| 216 |
+
// Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
|
| 217 |
+
// Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
|
| 218 |
+
// Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "50.000"
|
| 219 |
+
// Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
|
| 220 |
+
// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
|
| 221 |
+
// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
|
| 222 |
+
// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
|
| 223 |
+
// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
|
| 224 |
+
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "MAX 10"
|
| 225 |
+
// Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
|
| 226 |
+
// Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "1"
|
| 227 |
+
// Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
|
| 228 |
+
// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "Not Available"
|
| 229 |
+
// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
|
| 230 |
+
// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
|
| 231 |
+
// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT1 STRING "deg"
|
| 232 |
+
// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT2 STRING "ps"
|
| 233 |
+
// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT3 STRING "ps"
|
| 234 |
+
// Retrieval info: PRIVATE: MIG_DEVICE_SPEED_GRADE STRING "Any"
|
| 235 |
+
// Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
|
| 236 |
+
// Retrieval info: PRIVATE: MIRROR_CLK1 STRING "0"
|
| 237 |
+
// Retrieval info: PRIVATE: MIRROR_CLK2 STRING "0"
|
| 238 |
+
// Retrieval info: PRIVATE: MIRROR_CLK3 STRING "0"
|
| 239 |
+
// Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "1"
|
| 240 |
+
// Retrieval info: PRIVATE: MULT_FACTOR1 NUMERIC "1"
|
| 241 |
+
// Retrieval info: PRIVATE: MULT_FACTOR2 NUMERIC "1"
|
| 242 |
+
// Retrieval info: PRIVATE: MULT_FACTOR3 NUMERIC "4"
|
| 243 |
+
// Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
|
| 244 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "50.00000000"
|
| 245 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ1 STRING "50.00000000"
|
| 246 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ2 STRING "100.00000000"
|
| 247 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ3 STRING "100.00000000"
|
| 248 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
|
| 249 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE1 STRING "1"
|
| 250 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE2 STRING "0"
|
| 251 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE3 STRING "0"
|
| 252 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
|
| 253 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT1 STRING "MHz"
|
| 254 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT2 STRING "MHz"
|
| 255 |
+
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT3 STRING "MHz"
|
| 256 |
+
// Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "1"
|
| 257 |
+
// Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
|
| 258 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
|
| 259 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT1 STRING "0.00000000"
|
| 260 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT2 STRING "-12.00000000"
|
| 261 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT3 STRING "-60.00000000"
|
| 262 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT_STEP_ENABLED_CHECK STRING "0"
|
| 263 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "ns"
|
| 264 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT1 STRING "deg"
|
| 265 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT2 STRING "ns"
|
| 266 |
+
// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT3 STRING "deg"
|
| 267 |
+
// Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
|
| 268 |
+
// Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "0"
|
| 269 |
+
// Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
|
| 270 |
+
// Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
|
| 271 |
+
// Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
|
| 272 |
+
// Retrieval info: PRIVATE: PLL_FBMIMIC_CHECK STRING "0"
|
| 273 |
+
// Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
|
| 274 |
+
// Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
|
| 275 |
+
// Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
|
| 276 |
+
// Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
|
| 277 |
+
// Retrieval info: PRIVATE: RECONFIG_FILE STRING "pll.mif"
|
| 278 |
+
// Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
|
| 279 |
+
// Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "1"
|
| 280 |
+
// Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
|
| 281 |
+
// Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
|
| 282 |
+
// Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
|
| 283 |
+
// Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
|
| 284 |
+
// Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
|
| 285 |
+
// Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
|
| 286 |
+
// Retrieval info: PRIVATE: SPREAD_USE STRING "0"
|
| 287 |
+
// Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
|
| 288 |
+
// Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
|
| 289 |
+
// Retrieval info: PRIVATE: STICKY_CLK1 STRING "1"
|
| 290 |
+
// Retrieval info: PRIVATE: STICKY_CLK2 STRING "1"
|
| 291 |
+
// Retrieval info: PRIVATE: STICKY_CLK3 STRING "1"
|
| 292 |
+
// Retrieval info: PRIVATE: STICKY_CLK4 STRING "0"
|
| 293 |
+
// Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
|
| 294 |
+
// Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "1"
|
| 295 |
+
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
|
| 296 |
+
// Retrieval info: PRIVATE: USE_CLK0 STRING "1"
|
| 297 |
+
// Retrieval info: PRIVATE: USE_CLK1 STRING "1"
|
| 298 |
+
// Retrieval info: PRIVATE: USE_CLK2 STRING "1"
|
| 299 |
+
// Retrieval info: PRIVATE: USE_CLK3 STRING "1"
|
| 300 |
+
// Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
|
| 301 |
+
// Retrieval info: PRIVATE: USE_CLKENA1 STRING "0"
|
| 302 |
+
// Retrieval info: PRIVATE: USE_CLKENA2 STRING "0"
|
| 303 |
+
// Retrieval info: PRIVATE: USE_CLKENA3 STRING "0"
|
| 304 |
+
// Retrieval info: PRIVATE: USE_MIL_SPEED_GRADE NUMERIC "0"
|
| 305 |
+
// Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
|
| 306 |
+
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
|
| 307 |
+
// Retrieval info: CONSTANT: BANDWIDTH_TYPE STRING "AUTO"
|
| 308 |
+
// Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "5"
|
| 309 |
+
// Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
|
| 310 |
+
// Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "1"
|
| 311 |
+
// Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
|
| 312 |
+
// Retrieval info: CONSTANT: CLK1_DIVIDE_BY NUMERIC "1"
|
| 313 |
+
// Retrieval info: CONSTANT: CLK1_DUTY_CYCLE NUMERIC "50"
|
| 314 |
+
// Retrieval info: CONSTANT: CLK1_MULTIPLY_BY NUMERIC "1"
|
| 315 |
+
// Retrieval info: CONSTANT: CLK1_PHASE_SHIFT STRING "0"
|
| 316 |
+
// Retrieval info: CONSTANT: CLK2_DIVIDE_BY NUMERIC "1"
|
| 317 |
+
// Retrieval info: CONSTANT: CLK2_DUTY_CYCLE NUMERIC "50"
|
| 318 |
+
// Retrieval info: CONSTANT: CLK2_MULTIPLY_BY NUMERIC "1"
|
| 319 |
+
// Retrieval info: CONSTANT: CLK2_PHASE_SHIFT STRING "-12000"
|
| 320 |
+
// Retrieval info: CONSTANT: CLK3_DIVIDE_BY NUMERIC "1"
|
| 321 |
+
// Retrieval info: CONSTANT: CLK3_DUTY_CYCLE NUMERIC "50"
|
| 322 |
+
// Retrieval info: CONSTANT: CLK3_MULTIPLY_BY NUMERIC "4"
|
| 323 |
+
// Retrieval info: CONSTANT: CLK3_PHASE_SHIFT STRING "-833"
|
| 324 |
+
// Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
|
| 325 |
+
// Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "20000"
|
| 326 |
+
// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "MAX 10"
|
| 327 |
+
// Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
|
| 328 |
+
// Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
|
| 329 |
+
// Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
|
| 330 |
+
// Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
|
| 331 |
+
// Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_UNUSED"
|
| 332 |
+
// Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
|
| 333 |
+
// Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
|
| 334 |
+
// Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
|
| 335 |
+
// Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
|
| 336 |
+
// Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
|
| 337 |
+
// Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
|
| 338 |
+
// Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
|
| 339 |
+
// Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
|
| 340 |
+
// Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_USED"
|
| 341 |
+
// Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
|
| 342 |
+
// Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
|
| 343 |
+
// Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
|
| 344 |
+
// Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
|
| 345 |
+
// Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
|
| 346 |
+
// Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
|
| 347 |
+
// Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
|
| 348 |
+
// Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
|
| 349 |
+
// Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
|
| 350 |
+
// Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
|
| 351 |
+
// Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
|
| 352 |
+
// Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
|
| 353 |
+
// Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
|
| 354 |
+
// Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
|
| 355 |
+
// Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
|
| 356 |
+
// Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_USED"
|
| 357 |
+
// Retrieval info: CONSTANT: PORT_clk2 STRING "PORT_USED"
|
| 358 |
+
// Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_USED"
|
| 359 |
+
// Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
|
| 360 |
+
// Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
|
| 361 |
+
// Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
|
| 362 |
+
// Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
|
| 363 |
+
// Retrieval info: CONSTANT: PORT_clkena2 STRING "PORT_UNUSED"
|
| 364 |
+
// Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
|
| 365 |
+
// Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
|
| 366 |
+
// Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
|
| 367 |
+
// Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
|
| 368 |
+
// Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
|
| 369 |
+
// Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
|
| 370 |
+
// Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
|
| 371 |
+
// Retrieval info: CONSTANT: SELF_RESET_ON_LOSS_LOCK STRING "OFF"
|
| 372 |
+
// Retrieval info: CONSTANT: WIDTH_CLOCK NUMERIC "5"
|
| 373 |
+
// Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]"
|
| 374 |
+
// Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
|
| 375 |
+
// Retrieval info: USED_PORT: c1 0 0 0 0 OUTPUT_CLK_EXT VCC "c1"
|
| 376 |
+
// Retrieval info: USED_PORT: c2 0 0 0 0 OUTPUT_CLK_EXT VCC "c2"
|
| 377 |
+
// Retrieval info: USED_PORT: c3 0 0 0 0 OUTPUT_CLK_EXT VCC "c3"
|
| 378 |
+
// Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
|
| 379 |
+
// Retrieval info: USED_PORT: locked 0 0 0 0 OUTPUT GND "locked"
|
| 380 |
+
// Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
|
| 381 |
+
// Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
|
| 382 |
+
// Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
|
| 383 |
+
// Retrieval info: CONNECT: c1 0 0 0 0 @clk 0 0 1 1
|
| 384 |
+
// Retrieval info: CONNECT: c2 0 0 0 0 @clk 0 0 1 2
|
| 385 |
+
// Retrieval info: CONNECT: c3 0 0 0 0 @clk 0 0 1 3
|
| 386 |
+
// Retrieval info: CONNECT: locked 0 0 0 0 @locked 0 0 0 0
|
| 387 |
+
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.v TRUE
|
| 388 |
+
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.ppf TRUE
|
| 389 |
+
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.inc FALSE
|
| 390 |
+
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.cmp FALSE
|
| 391 |
+
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.bsf FALSE
|
| 392 |
+
// Retrieval info: GEN_FILE: TYPE_NORMAL pll_inst.v FALSE
|
| 393 |
+
// Retrieval info: GEN_FILE: TYPE_NORMAL pll_bb.v FALSE
|
| 394 |
+
// Retrieval info: LIB_FILE: altera_mf
|
| 395 |
+
// Retrieval info: CBX_MODULE_PREFIX: ON
|
MIPSfpga_mipsfpga-plus/boards/de10_nano/de10_nano.sdc
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**************************************************************
|
| 2 |
+
# This .sdc file is created by Terasic Tool.
|
| 3 |
+
# Users are recommended to modify this file to match users logic.
|
| 4 |
+
#**************************************************************
|
| 5 |
+
|
| 6 |
+
#**************************************************************
|
| 7 |
+
# Create Clock
|
| 8 |
+
#**************************************************************
|
| 9 |
+
create_clock -period "50.0 MHz" [get_ports FPGA_CLK1_50]
|
| 10 |
+
create_clock -period "50.0 MHz" [get_ports FPGA_CLK2_50]
|
| 11 |
+
create_clock -period "50.0 MHz" [get_ports FPGA_CLK3_50]
|
| 12 |
+
|
| 13 |
+
# for enhancing USB BlasterII to be reliable, 25MHz
|
| 14 |
+
create_clock -name {altera_reserved_tck} -period 40 {altera_reserved_tck}
|
| 15 |
+
set_input_delay -clock altera_reserved_tck -clock_fall 3 [get_ports altera_reserved_tdi]
|
| 16 |
+
set_input_delay -clock altera_reserved_tck -clock_fall 3 [get_ports altera_reserved_tms]
|
| 17 |
+
set_output_delay -clock altera_reserved_tck 3 [get_ports altera_reserved_tdo]
|
| 18 |
+
|
| 19 |
+
#**************************************************************
|
| 20 |
+
# Create Generated Clock
|
| 21 |
+
#**************************************************************
|
| 22 |
+
derive_pll_clocks
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
#**************************************************************
|
| 27 |
+
# Set Clock Latency
|
| 28 |
+
#**************************************************************
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
#**************************************************************
|
| 33 |
+
# Set Clock Uncertainty
|
| 34 |
+
#**************************************************************
|
| 35 |
+
derive_clock_uncertainty
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
#**************************************************************
|
| 40 |
+
# Set Input Delay
|
| 41 |
+
#**************************************************************
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
#**************************************************************
|
| 46 |
+
# Set Output Delay
|
| 47 |
+
#**************************************************************
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
#**************************************************************
|
| 52 |
+
# Set Clock Groups
|
| 53 |
+
#**************************************************************
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
#**************************************************************
|
| 58 |
+
# Set False Path
|
| 59 |
+
#**************************************************************
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
#**************************************************************
|
| 64 |
+
# Set Multicycle Path
|
| 65 |
+
#**************************************************************
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
#**************************************************************
|
| 70 |
+
# Set Maximum Delay
|
| 71 |
+
#**************************************************************
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
#**************************************************************
|
| 76 |
+
# Set Minimum Delay
|
| 77 |
+
#**************************************************************
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
#**************************************************************
|
| 82 |
+
# Set Input Transition
|
| 83 |
+
#**************************************************************
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
#**************************************************************
|
| 88 |
+
# Set Load
|
| 89 |
+
#**************************************************************
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
|
MIPSfpga_mipsfpga-plus/boards/de10_nano/de10_nano.v
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module de10_nano(
|
| 4 |
+
|
| 5 |
+
//////////// ADC //////////
|
| 6 |
+
output ADC_CONVST,
|
| 7 |
+
output ADC_SCK,
|
| 8 |
+
output ADC_SDI,
|
| 9 |
+
input ADC_SDO,
|
| 10 |
+
|
| 11 |
+
//////////// ARDUINO //////////
|
| 12 |
+
inout [15:0] ARDUINO_IO,
|
| 13 |
+
inout ARDUINO_RESET_N,
|
| 14 |
+
|
| 15 |
+
//////////// CLOCK //////////
|
| 16 |
+
input FPGA_CLK1_50,
|
| 17 |
+
input FPGA_CLK2_50,
|
| 18 |
+
input FPGA_CLK3_50,
|
| 19 |
+
|
| 20 |
+
//////////// HDMI //////////
|
| 21 |
+
inout HDMI_I2C_SCL,
|
| 22 |
+
inout HDMI_I2C_SDA,
|
| 23 |
+
inout HDMI_I2S,
|
| 24 |
+
inout HDMI_LRCLK,
|
| 25 |
+
inout HDMI_MCLK,
|
| 26 |
+
inout HDMI_SCLK,
|
| 27 |
+
output HDMI_TX_CLK,
|
| 28 |
+
output HDMI_TX_DE,
|
| 29 |
+
output [23:0] HDMI_TX_D,
|
| 30 |
+
output HDMI_TX_HS,
|
| 31 |
+
input HDMI_TX_INT,
|
| 32 |
+
output HDMI_TX_VS,
|
| 33 |
+
|
| 34 |
+
//////////// KEY //////////
|
| 35 |
+
input [1:0] KEY,
|
| 36 |
+
|
| 37 |
+
//////////// LED //////////
|
| 38 |
+
output [7:0] LED,
|
| 39 |
+
|
| 40 |
+
//////////// SW //////////
|
| 41 |
+
input [3:0] SW,
|
| 42 |
+
|
| 43 |
+
//////////// GPIO_0, GPIO connect to GPIO Default //////////
|
| 44 |
+
inout [35:0] GPIO_0,
|
| 45 |
+
|
| 46 |
+
//////////// GPIO_1, GPIO connect to GPIO Default //////////
|
| 47 |
+
inout [35:0] GPIO_1
|
| 48 |
+
);
|
| 49 |
+
|
| 50 |
+
// global clock signals
|
| 51 |
+
wire clk;
|
| 52 |
+
|
| 53 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 54 |
+
|
| 55 |
+
wire muxed_clk;
|
| 56 |
+
wire [1:0] sw_db;
|
| 57 |
+
|
| 58 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 59 |
+
# (.WIDTH (2))
|
| 60 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 61 |
+
(
|
| 62 |
+
.clk ( FPGA_CLK1_50 ),
|
| 63 |
+
.sw_in ( SW [1:0] ),
|
| 64 |
+
.sw_out ( sw_db )
|
| 65 |
+
);
|
| 66 |
+
|
| 67 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 68 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 69 |
+
(
|
| 70 |
+
.clki ( FPGA_CLK1_50 ),
|
| 71 |
+
.sel_lo ( sw_db [0] ),
|
| 72 |
+
.sel_mid ( sw_db [1] ),
|
| 73 |
+
.clko ( muxed_clk )
|
| 74 |
+
);
|
| 75 |
+
|
| 76 |
+
global gclk
|
| 77 |
+
(
|
| 78 |
+
.in ( muxed_clk ),
|
| 79 |
+
.out ( clk )
|
| 80 |
+
);
|
| 81 |
+
|
| 82 |
+
`else
|
| 83 |
+
assign clk = FPGA_CLK1_50;
|
| 84 |
+
`endif
|
| 85 |
+
|
| 86 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 87 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 88 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 89 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 90 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 91 |
+
|
| 92 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 4 { 1'b0 } } , SW [3:0] };
|
| 93 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 2 { 1'b0 } } , ~ KEY [1:0] };
|
| 94 |
+
|
| 95 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 96 |
+
wire HWRITE;
|
| 97 |
+
|
| 98 |
+
assign LED = IO_GreenLEDs [7:0];
|
| 99 |
+
|
| 100 |
+
//This is a workaround to make EJTAG working
|
| 101 |
+
//TODO: add complex reset signals handling module
|
| 102 |
+
wire RESETn = KEY [0] & GPIO_0 [20];
|
| 103 |
+
|
| 104 |
+
mfp_system mfp_system
|
| 105 |
+
(
|
| 106 |
+
.SI_ClkIn ( clk ),
|
| 107 |
+
.SI_Reset ( ~RESETn ),
|
| 108 |
+
|
| 109 |
+
.HADDR ( HADDR ),
|
| 110 |
+
.HRDATA ( HRDATA ),
|
| 111 |
+
.HWDATA ( HWDATA ),
|
| 112 |
+
.HWRITE ( HWRITE ),
|
| 113 |
+
|
| 114 |
+
.EJ_TRST_N_probe ( GPIO_0 [22] ),
|
| 115 |
+
.EJ_TDI ( GPIO_0 [21] ),
|
| 116 |
+
.EJ_TDO ( GPIO_0 [19] ),
|
| 117 |
+
.EJ_TMS ( GPIO_0 [23] ),
|
| 118 |
+
.EJ_TCK ( GPIO_0 [17] ),
|
| 119 |
+
.SI_ColdReset ( ~ GPIO_0 [20] ),
|
| 120 |
+
.EJ_DINT ( 1'b0 ),
|
| 121 |
+
|
| 122 |
+
.IO_Switches ( IO_Switches ),
|
| 123 |
+
.IO_Buttons ( IO_Buttons ),
|
| 124 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 125 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 126 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 127 |
+
|
| 128 |
+
.UART_RX ( GPIO_0 [31] ),
|
| 129 |
+
.UART_TX ( GPIO_0 [32] ),
|
| 130 |
+
|
| 131 |
+
`ifdef MFP_USE_DUPLEX_UART
|
| 132 |
+
.UART_SRX ( GPIO_0 [33] ),
|
| 133 |
+
.UART_STX ( GPIO_0 [35] ),
|
| 134 |
+
`endif
|
| 135 |
+
|
| 136 |
+
.SPI_CS ( GPIO_0 [34] ),
|
| 137 |
+
.SPI_SCK ( GPIO_0 [28] ),
|
| 138 |
+
.SPI_SDO ( GPIO_0 [30] )
|
| 139 |
+
);
|
| 140 |
+
|
| 141 |
+
assign GPIO_0 [15] = 1'b0;
|
| 142 |
+
assign GPIO_0 [14] = 1'b0;
|
| 143 |
+
assign GPIO_0 [13] = 1'b1;
|
| 144 |
+
assign GPIO_0 [12] = 1'b1;
|
| 145 |
+
|
| 146 |
+
assign GPIO_0 [26] = 1'b0;
|
| 147 |
+
|
| 148 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/de2_115/de2_115.sdc
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#**************************************************************
|
| 2 |
+
# Create Clock
|
| 3 |
+
#**************************************************************
|
| 4 |
+
|
| 5 |
+
create_clock -period 20 [get_ports CLOCK_50]
|
| 6 |
+
create_clock -period 20 [get_ports CLOCK2_50]
|
| 7 |
+
create_clock -period 20 [get_ports CLOCK3_50]
|
| 8 |
+
create_clock -period 40 [get_nets mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz|clko]
|
| 9 |
+
#create_clock -period 40 [get_nets de1|clk]
|
| 10 |
+
create_clock -period 20 [get_ports GPIO_1[17]]
|
| 11 |
+
|
| 12 |
+
#**************************************************************
|
| 13 |
+
# Create Generated Clock
|
| 14 |
+
#**************************************************************
|
| 15 |
+
|
| 16 |
+
derive_pll_clocks
|
| 17 |
+
|
| 18 |
+
#**************************************************************
|
| 19 |
+
# Set Clock Latency
|
| 20 |
+
#**************************************************************
|
| 21 |
+
|
| 22 |
+
#**************************************************************
|
| 23 |
+
# Set Clock Uncertainty
|
| 24 |
+
#**************************************************************
|
| 25 |
+
|
| 26 |
+
derive_clock_uncertainty
|
| 27 |
+
|
| 28 |
+
#**************************************************************
|
| 29 |
+
# Set Input Delay
|
| 30 |
+
#**************************************************************
|
| 31 |
+
|
| 32 |
+
#**************************************************************
|
| 33 |
+
# Set Output Delay
|
| 34 |
+
#**************************************************************
|
| 35 |
+
|
| 36 |
+
#**************************************************************
|
| 37 |
+
# Set Clock Groups
|
| 38 |
+
##**************************************************************
|
| 39 |
+
|
| 40 |
+
#**************************************************************
|
| 41 |
+
# Set False Path
|
| 42 |
+
#**************************************************************
|
| 43 |
+
|
| 44 |
+
#**************************************************************
|
| 45 |
+
# Set Multicycle Path
|
| 46 |
+
#**************************************************************
|
| 47 |
+
|
| 48 |
+
#**************************************************************
|
| 49 |
+
# Set Maximum Delay
|
| 50 |
+
#**************************************************************
|
| 51 |
+
|
| 52 |
+
#**************************************************************
|
| 53 |
+
# Set Minimum Delay
|
| 54 |
+
#**************************************************************
|
| 55 |
+
|
| 56 |
+
#**************************************************************
|
| 57 |
+
# Set Input Transition
|
| 58 |
+
#**************************************************************
|
| 59 |
+
|
| 60 |
+
#**************************************************************
|
| 61 |
+
# Set Load
|
| 62 |
+
#**************************************************************
|
MIPSfpga_mipsfpga-plus/boards/de2_115/de2_115.v
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module de2_115
|
| 4 |
+
(
|
| 5 |
+
input CLOCK_50,
|
| 6 |
+
input CLOCK2_50,
|
| 7 |
+
input CLOCK3_50,
|
| 8 |
+
input ENETCLK_25,
|
| 9 |
+
|
| 10 |
+
// Sma
|
| 11 |
+
|
| 12 |
+
input SMA_CLKIN,
|
| 13 |
+
output SMA_CLKOUT,
|
| 14 |
+
|
| 15 |
+
// LED
|
| 16 |
+
|
| 17 |
+
output [ 8:0] LEDG,
|
| 18 |
+
output [17:0] LEDR,
|
| 19 |
+
|
| 20 |
+
// KEY
|
| 21 |
+
|
| 22 |
+
input [ 3:0] KEY,
|
| 23 |
+
|
| 24 |
+
// SW
|
| 25 |
+
|
| 26 |
+
input [17:0] SW,
|
| 27 |
+
|
| 28 |
+
// SEG7
|
| 29 |
+
|
| 30 |
+
output [ 6:0] HEX0,
|
| 31 |
+
output [ 6:0] HEX1,
|
| 32 |
+
output [ 6:0] HEX2,
|
| 33 |
+
output [ 6:0] HEX3,
|
| 34 |
+
output [ 6:0] HEX4,
|
| 35 |
+
output [ 6:0] HEX5,
|
| 36 |
+
output [ 6:0] HEX6,
|
| 37 |
+
output [ 6:0] HEX7,
|
| 38 |
+
|
| 39 |
+
`ifdef UNUSED
|
| 40 |
+
|
| 41 |
+
// LCD
|
| 42 |
+
|
| 43 |
+
output LCD_BLON,
|
| 44 |
+
inout [ 7:0] LCD_DATA,
|
| 45 |
+
output LCD_EN,
|
| 46 |
+
output LCD_ON,
|
| 47 |
+
output LCD_RS,
|
| 48 |
+
output LCD_RW,
|
| 49 |
+
|
| 50 |
+
// RS232
|
| 51 |
+
|
| 52 |
+
output UART_CTS,
|
| 53 |
+
input UART_RTS,
|
| 54 |
+
input UART_RXD,
|
| 55 |
+
output UART_TXD,
|
| 56 |
+
|
| 57 |
+
// PS2
|
| 58 |
+
|
| 59 |
+
inout PS2_CLK,
|
| 60 |
+
inout PS2_DAT,
|
| 61 |
+
inout PS2_CLK2,
|
| 62 |
+
inout PS2_DAT2,
|
| 63 |
+
|
| 64 |
+
// SDCARD
|
| 65 |
+
|
| 66 |
+
output SD_CLK,
|
| 67 |
+
inout SD_CMD,
|
| 68 |
+
inout [ 3:0] SD_DAT,
|
| 69 |
+
input SD_WP_N,
|
| 70 |
+
|
| 71 |
+
// VGA
|
| 72 |
+
|
| 73 |
+
output [ 7:0] VGA_B,
|
| 74 |
+
output VGA_BLANK_N,
|
| 75 |
+
output VGA_CLK,
|
| 76 |
+
output [ 7:0] VGA_G,
|
| 77 |
+
output VGA_HS,
|
| 78 |
+
output [ 7:0] VGA_R,
|
| 79 |
+
output VGA_SYNC_N,
|
| 80 |
+
output VGA_VS,
|
| 81 |
+
|
| 82 |
+
// Audio
|
| 83 |
+
|
| 84 |
+
input AUD_ADCDAT,
|
| 85 |
+
inout AUD_ADCLRCK,
|
| 86 |
+
inout AUD_BCLK,
|
| 87 |
+
output AUD_DACDAT,
|
| 88 |
+
inout AUD_DACLRCK,
|
| 89 |
+
output AUD_XCK,
|
| 90 |
+
|
| 91 |
+
// I2C for EEPROM
|
| 92 |
+
|
| 93 |
+
output EEP_I2C_SCLK,
|
| 94 |
+
inout EEP_I2C_SDAT,
|
| 95 |
+
|
| 96 |
+
// I2C for Audio and Tv-Decode
|
| 97 |
+
|
| 98 |
+
output I2C_SCLK,
|
| 99 |
+
inout I2C_SDAT,
|
| 100 |
+
|
| 101 |
+
// Ethernet 0
|
| 102 |
+
|
| 103 |
+
output ENET0_GTX_CLK,
|
| 104 |
+
input ENET0_INT_N,
|
| 105 |
+
output ENET0_MDC,
|
| 106 |
+
input ENET0_MDIO,
|
| 107 |
+
output ENET0_RST_N,
|
| 108 |
+
input ENET0_RX_CLK,
|
| 109 |
+
input ENET0_RX_COL,
|
| 110 |
+
input ENET0_RX_CRS,
|
| 111 |
+
input [ 3:0] ENET0_RX_DATA,
|
| 112 |
+
input ENET0_RX_DV,
|
| 113 |
+
input ENET0_RX_ER,
|
| 114 |
+
input ENET0_TX_CLK,
|
| 115 |
+
output [ 3:0] ENET0_TX_DATA,
|
| 116 |
+
output ENET0_TX_EN,
|
| 117 |
+
output ENET0_TX_ER,
|
| 118 |
+
input ENET0_LINK100,
|
| 119 |
+
|
| 120 |
+
// Ethernet 1
|
| 121 |
+
|
| 122 |
+
output ENET1_GTX_CLK,
|
| 123 |
+
input ENET1_INT_N,
|
| 124 |
+
output ENET1_MDC,
|
| 125 |
+
input ENET1_MDIO,
|
| 126 |
+
output ENET1_RST_N,
|
| 127 |
+
input ENET1_RX_CLK,
|
| 128 |
+
input ENET1_RX_COL,
|
| 129 |
+
input ENET1_RX_CRS,
|
| 130 |
+
input [ 3:0] ENET1_RX_DATA,
|
| 131 |
+
input ENET1_RX_DV,
|
| 132 |
+
input ENET1_RX_ER,
|
| 133 |
+
input ENET1_TX_CLK,
|
| 134 |
+
output [ 3:0] ENET1_TX_DATA,
|
| 135 |
+
output ENET1_TX_EN,
|
| 136 |
+
output ENET1_TX_ER,
|
| 137 |
+
input ENET1_LINK100,
|
| 138 |
+
|
| 139 |
+
// TV Decoder 1
|
| 140 |
+
|
| 141 |
+
input TD_CLK27,
|
| 142 |
+
input [ 7:0] TD_DATA,
|
| 143 |
+
input TD_HS,
|
| 144 |
+
output TD_RESET_N,
|
| 145 |
+
input TD_VS,
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
// USB OTG controller
|
| 149 |
+
|
| 150 |
+
inout [15:0] OTG_DATA,
|
| 151 |
+
output [ 1:0] OTG_ADDR,
|
| 152 |
+
output OTG_CS_N,
|
| 153 |
+
output OTG_WR_N,
|
| 154 |
+
output OTG_RD_N,
|
| 155 |
+
input OTG_INT,
|
| 156 |
+
output OTG_RST_N,
|
| 157 |
+
|
| 158 |
+
// IR Receiver
|
| 159 |
+
|
| 160 |
+
input IRDA_RXD,
|
| 161 |
+
|
| 162 |
+
// SDRAM
|
| 163 |
+
|
| 164 |
+
output [12:0] DRAM_ADDR,
|
| 165 |
+
output [ 1:0] DRAM_BA,
|
| 166 |
+
output DRAM_CAS_N,
|
| 167 |
+
output DRAM_CKE,
|
| 168 |
+
output DRAM_CLK,
|
| 169 |
+
output DRAM_CS_N,
|
| 170 |
+
inout [31:0] DRAM_DQ,
|
| 171 |
+
output [ 3:0] DRAM_DQM,
|
| 172 |
+
output DRAM_RAS_N,
|
| 173 |
+
output DRAM_WE_N,
|
| 174 |
+
|
| 175 |
+
// SRAM
|
| 176 |
+
|
| 177 |
+
output [19:0] SRAM_ADDR,
|
| 178 |
+
output SRAM_CE_N,
|
| 179 |
+
inout [15:0] SRAM_DQ,
|
| 180 |
+
output SRAM_LB_N,
|
| 181 |
+
output SRAM_OE_N,
|
| 182 |
+
output SRAM_UB_N,
|
| 183 |
+
output SRAM_WE_N,
|
| 184 |
+
|
| 185 |
+
// Flash
|
| 186 |
+
|
| 187 |
+
output [22:0] FL_ADDR,
|
| 188 |
+
output FL_CE_N,
|
| 189 |
+
inout [ 7:0] FL_DQ,
|
| 190 |
+
output FL_OE_N,
|
| 191 |
+
output FL_RST_N,
|
| 192 |
+
input FL_RY,
|
| 193 |
+
output FL_WE_N,
|
| 194 |
+
output FL_WP_N,
|
| 195 |
+
|
| 196 |
+
`endif
|
| 197 |
+
|
| 198 |
+
// GPIO
|
| 199 |
+
|
| 200 |
+
inout [35:0] GPIO,
|
| 201 |
+
|
| 202 |
+
`ifdef UNUSED
|
| 203 |
+
|
| 204 |
+
// HSMC (LVDS)
|
| 205 |
+
|
| 206 |
+
// input HSMC_CLKIN_N1,
|
| 207 |
+
// input HSMC_CLKIN_N2,
|
| 208 |
+
input HSMC_CLKIN_P1,
|
| 209 |
+
input HSMC_CLKIN_P2,
|
| 210 |
+
input HSMC_CLKIN0,
|
| 211 |
+
// output HSMC_CLKOUT_N1,
|
| 212 |
+
// output HSMC_CLKOUT_N2,
|
| 213 |
+
output HSMC_CLKOUT_P1,
|
| 214 |
+
output HSMC_CLKOUT_P2,
|
| 215 |
+
output HSMC_CLKOUT0,
|
| 216 |
+
inout [ 3:0] HSMC_D,
|
| 217 |
+
// input [16:0] HSMC_RX_D_N,
|
| 218 |
+
input [16:0] HSMC_RX_D_P,
|
| 219 |
+
// output [16:0] HSMC_TX_D_N,
|
| 220 |
+
output [16:0] HSMC_TX_D_P,
|
| 221 |
+
|
| 222 |
+
`endif
|
| 223 |
+
|
| 224 |
+
// EXTEND IO
|
| 225 |
+
|
| 226 |
+
inout [ 6:0] EX_IO
|
| 227 |
+
);
|
| 228 |
+
|
| 229 |
+
wire clk;
|
| 230 |
+
|
| 231 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 232 |
+
|
| 233 |
+
wire muxed_clk;
|
| 234 |
+
wire [1:0] sw_db;
|
| 235 |
+
|
| 236 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 237 |
+
# (.WIDTH (2))
|
| 238 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 239 |
+
(
|
| 240 |
+
.clk ( CLOCK_50 ),
|
| 241 |
+
.sw_in ( SW [1:0] ),
|
| 242 |
+
.sw_out ( sw_db )
|
| 243 |
+
);
|
| 244 |
+
|
| 245 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 246 |
+
mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 247 |
+
(
|
| 248 |
+
.clki ( CLOCK_50 ),
|
| 249 |
+
.sel_lo ( sw_db [0] ),
|
| 250 |
+
.sel_mid ( sw_db [1] ),
|
| 251 |
+
.clko ( muxed_clk )
|
| 252 |
+
);
|
| 253 |
+
|
| 254 |
+
global gclk
|
| 255 |
+
(
|
| 256 |
+
.in ( muxed_clk ),
|
| 257 |
+
.out ( clk )
|
| 258 |
+
);
|
| 259 |
+
|
| 260 |
+
`else
|
| 261 |
+
|
| 262 |
+
assign clk = CLOCK_50;
|
| 263 |
+
|
| 264 |
+
`endif
|
| 265 |
+
|
| 266 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 267 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 268 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 269 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 270 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 271 |
+
|
| 272 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 18 { 1'b0 } } , SW [17:0] };
|
| 273 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 4 { 1'b0 } } , ~ KEY [ 3:0] };
|
| 274 |
+
|
| 275 |
+
assign LEDG = IO_GreenLEDs [ 8:0];
|
| 276 |
+
assign LEDR = IO_RedLEDs [17:0];
|
| 277 |
+
|
| 278 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 279 |
+
wire HWRITE;
|
| 280 |
+
|
| 281 |
+
mfp_system mfp_system
|
| 282 |
+
(
|
| 283 |
+
.SI_ClkIn ( clk ),
|
| 284 |
+
.SI_Reset ( ~ KEY [0] ),
|
| 285 |
+
|
| 286 |
+
.HADDR ( HADDR ),
|
| 287 |
+
.HRDATA ( HRDATA ),
|
| 288 |
+
.HWDATA ( HWDATA ),
|
| 289 |
+
.HWRITE ( HWRITE ),
|
| 290 |
+
|
| 291 |
+
`ifdef MFP_USE_GPIO_FOR_EJTAG
|
| 292 |
+
|
| 293 |
+
.EJ_TRST_N_probe ( GPIO [22] ),
|
| 294 |
+
.EJ_TDI ( GPIO [21] ),
|
| 295 |
+
.EJ_TDO ( GPIO [19] ),
|
| 296 |
+
.EJ_TMS ( GPIO [23] ),
|
| 297 |
+
.EJ_TCK ( GPIO [17] ),
|
| 298 |
+
.SI_ColdReset ( ~ GPIO [20] ),
|
| 299 |
+
.EJ_DINT ( 1'b0 ),
|
| 300 |
+
|
| 301 |
+
`else
|
| 302 |
+
|
| 303 |
+
.EJ_TRST_N_probe ( EX_IO [6] ),
|
| 304 |
+
.EJ_TDI ( EX_IO [5] ),
|
| 305 |
+
.EJ_TDO ( EX_IO [4] ),
|
| 306 |
+
.EJ_TMS ( EX_IO [3] ),
|
| 307 |
+
.EJ_TCK ( EX_IO [2] ),
|
| 308 |
+
.SI_ColdReset ( ~ EX_IO [1] ),
|
| 309 |
+
.EJ_DINT ( EX_IO [0] ),
|
| 310 |
+
|
| 311 |
+
`endif
|
| 312 |
+
|
| 313 |
+
.IO_Switches ( IO_Switches ),
|
| 314 |
+
.IO_Buttons ( IO_Buttons ),
|
| 315 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 316 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 317 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 318 |
+
|
| 319 |
+
.UART_RX ( GPIO [31] ),
|
| 320 |
+
.UART_TX ( /* TODO */ ),
|
| 321 |
+
|
| 322 |
+
.SPI_CS ( GPIO [34] ),
|
| 323 |
+
.SPI_SCK ( GPIO [28] ),
|
| 324 |
+
.SPI_SDO ( GPIO [30] )
|
| 325 |
+
);
|
| 326 |
+
|
| 327 |
+
assign GPIO [15] = 1'b0;
|
| 328 |
+
assign GPIO [14] = 1'b0;
|
| 329 |
+
assign GPIO [13] = 1'b1;
|
| 330 |
+
assign GPIO [12] = 1'b1;
|
| 331 |
+
|
| 332 |
+
assign GPIO [26] = 1'b0;
|
| 333 |
+
|
| 334 |
+
mfp_single_digit_seven_segment_display digit_7 ( IO_7_SegmentHEX [31:28] , HEX7 );
|
| 335 |
+
mfp_single_digit_seven_segment_display digit_6 ( IO_7_SegmentHEX [27:24] , HEX6 );
|
| 336 |
+
mfp_single_digit_seven_segment_display digit_5 ( IO_7_SegmentHEX [23:20] , HEX5 );
|
| 337 |
+
mfp_single_digit_seven_segment_display digit_4 ( IO_7_SegmentHEX [19:16] , HEX4 );
|
| 338 |
+
mfp_single_digit_seven_segment_display digit_3 ( IO_7_SegmentHEX [15:12] , HEX3 );
|
| 339 |
+
mfp_single_digit_seven_segment_display digit_2 ( IO_7_SegmentHEX [11: 8] , HEX2 );
|
| 340 |
+
mfp_single_digit_seven_segment_display digit_1 ( IO_7_SegmentHEX [ 7: 4] , HEX1 );
|
| 341 |
+
mfp_single_digit_seven_segment_display digit_0 ( IO_7_SegmentHEX [ 3: 0] , HEX0 );
|
| 342 |
+
|
| 343 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/nexys4/nexys4.v
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module nexys4
|
| 4 |
+
(
|
| 5 |
+
input clk,
|
| 6 |
+
input btnCpuReset,
|
| 7 |
+
|
| 8 |
+
input btnC,
|
| 9 |
+
input btnU,
|
| 10 |
+
input btnL,
|
| 11 |
+
input btnR,
|
| 12 |
+
input btnD,
|
| 13 |
+
|
| 14 |
+
input [15:0] sw,
|
| 15 |
+
|
| 16 |
+
output [15:0] led,
|
| 17 |
+
|
| 18 |
+
output RGB1_Red,
|
| 19 |
+
output RGB1_Green,
|
| 20 |
+
output RGB1_Blue,
|
| 21 |
+
output RGB2_Red,
|
| 22 |
+
output RGB2_Green,
|
| 23 |
+
output RGB2_Blue,
|
| 24 |
+
|
| 25 |
+
output [ 6:0] seg,
|
| 26 |
+
output dp,
|
| 27 |
+
output [ 7:0] an,
|
| 28 |
+
|
| 29 |
+
inout [ 7:0] JA,
|
| 30 |
+
inout [ 7:0] JB,
|
| 31 |
+
|
| 32 |
+
input RsRx
|
| 33 |
+
);
|
| 34 |
+
|
| 35 |
+
wire clock;
|
| 36 |
+
wire reset = ~ btnCpuReset;
|
| 37 |
+
|
| 38 |
+
`define MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 39 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 40 |
+
|
| 41 |
+
wire muxed_clk;
|
| 42 |
+
wire [1:0] sw_db;
|
| 43 |
+
|
| 44 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 45 |
+
# (.WIDTH (2))
|
| 46 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 47 |
+
(
|
| 48 |
+
.clk ( clk ),
|
| 49 |
+
.sw_in ( sw [1:0] ),
|
| 50 |
+
.sw_out ( sw_db )
|
| 51 |
+
);
|
| 52 |
+
|
| 53 |
+
mfp_clock_divider_100_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 54 |
+
mfp_clock_divider_100_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 55 |
+
(
|
| 56 |
+
.clki ( clk ),
|
| 57 |
+
.sel_lo ( sw_db [0] ),
|
| 58 |
+
.sel_mid ( sw_db [1] ),
|
| 59 |
+
.clko ( muxed_clk )
|
| 60 |
+
);
|
| 61 |
+
|
| 62 |
+
BUFG BUFG_slow_clk (.O ( clock ), .I ( muxed_clk ));
|
| 63 |
+
|
| 64 |
+
`else
|
| 65 |
+
|
| 66 |
+
clk_wiz_0 clk_wiz_0 (.clk_in1 (clk), .clk_out1 (clock));
|
| 67 |
+
|
| 68 |
+
`endif
|
| 69 |
+
|
| 70 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 71 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 72 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 73 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 74 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 75 |
+
|
| 76 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 16 { 1'b0 } } , sw [15:0] };
|
| 77 |
+
|
| 78 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 5 { 1'b0 } } ,
|
| 79 |
+
btnU, btnD, btnL, btnC, btnR };
|
| 80 |
+
|
| 81 |
+
assign led = IO_GreenLEDs [15:0];
|
| 82 |
+
|
| 83 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 84 |
+
wire HWRITE;
|
| 85 |
+
|
| 86 |
+
wire ejtag_tck_in, ejtag_tck;
|
| 87 |
+
|
| 88 |
+
IBUF IBUF (.O ( ejtag_tck_in ), .I ( JB [3] ));
|
| 89 |
+
BUFG BUFG_ejtag_tck (.O ( ejtag_tck ), .I ( ejtag_tck_in ));
|
| 90 |
+
|
| 91 |
+
mfp_system mfp_system
|
| 92 |
+
(
|
| 93 |
+
.SI_ClkIn ( clock ),
|
| 94 |
+
.SI_Reset ( reset ),
|
| 95 |
+
|
| 96 |
+
.HADDR ( HADDR ),
|
| 97 |
+
.HRDATA ( HRDATA ),
|
| 98 |
+
.HWDATA ( HWDATA ),
|
| 99 |
+
.HWRITE ( HWRITE ),
|
| 100 |
+
|
| 101 |
+
.EJ_TRST_N_probe ( JB [4] ),
|
| 102 |
+
.EJ_TDI ( JB [1] ),
|
| 103 |
+
.EJ_TDO ( JB [2] ),
|
| 104 |
+
.EJ_TMS ( JB [0] ),
|
| 105 |
+
.EJ_TCK ( ejtag_tck_in ),
|
| 106 |
+
.SI_ColdReset ( ~ JB [5] ),
|
| 107 |
+
.EJ_DINT ( 1'b0 ),
|
| 108 |
+
|
| 109 |
+
.IO_Switches ( IO_Switches ),
|
| 110 |
+
.IO_Buttons ( IO_Buttons ),
|
| 111 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 112 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 113 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 114 |
+
|
| 115 |
+
.UART_RX ( RsRx /* Alternative: JA [7] */ ),
|
| 116 |
+
.UART_TX ( /* TODO */ ),
|
| 117 |
+
|
| 118 |
+
.SPI_CS ( JA [0] ),
|
| 119 |
+
.SPI_SCK ( JA [3] ),
|
| 120 |
+
.SPI_SDO ( JA [2] )
|
| 121 |
+
);
|
| 122 |
+
|
| 123 |
+
assign JA [4] = 1'b0;
|
| 124 |
+
|
| 125 |
+
wire display_clock;
|
| 126 |
+
|
| 127 |
+
mfp_clock_divider_100_MHz_to_763_Hz mfp_clock_divider_100_MHz_to_763_Hz
|
| 128 |
+
(clk, display_clock);
|
| 129 |
+
|
| 130 |
+
mfp_multi_digit_display multi_digit_display
|
| 131 |
+
(
|
| 132 |
+
.clock ( display_clock ),
|
| 133 |
+
.resetn ( ~ reset ),
|
| 134 |
+
.number ( IO_7_SegmentHEX ),
|
| 135 |
+
|
| 136 |
+
.seven_segments ( seg ),
|
| 137 |
+
.dot ( dp ),
|
| 138 |
+
.anodes ( an )
|
| 139 |
+
);
|
| 140 |
+
|
| 141 |
+
assign RGB1_Red = 1'b0;
|
| 142 |
+
assign RGB1_Green = 1'b0;
|
| 143 |
+
assign RGB1_Blue = 1'b0;
|
| 144 |
+
assign RGB2_Red = 1'b0;
|
| 145 |
+
assign RGB2_Green = 1'b0;
|
| 146 |
+
assign RGB2_Blue = 1'b0;
|
| 147 |
+
|
| 148 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/nexys4/system_create.tcl
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# path where project will be created
|
| 3 |
+
set project_path [pwd]
|
| 4 |
+
set script_path [file dirname [file normalize [info script]]]
|
| 5 |
+
|
| 6 |
+
# global settings
|
| 7 |
+
set project_name "system"
|
| 8 |
+
set project_part "xc7a100tcsg324-1"
|
| 9 |
+
set testbench_top "mfp_testbench"
|
| 10 |
+
|
| 11 |
+
# source files path
|
| 12 |
+
set rtl_path $project_path/../rtl
|
| 13 |
+
set tb_path $project_path/../tb
|
| 14 |
+
|
| 15 |
+
# project local settings
|
| 16 |
+
set source_files [list \
|
| 17 |
+
"[file normalize "../nexys4.v"]" \
|
| 18 |
+
"[file normalize "../../../system_rtl/mfp_ahb_gpio_slave.v"]" \
|
| 19 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_adc_max10.v"]" \
|
| 20 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_eic.v"]" \
|
| 21 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix_config.vh"]" \
|
| 22 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix.v"]" \
|
| 23 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix_with_loader.v"]" \
|
| 24 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_pmod_als.v"]" \
|
| 25 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_slave.v"]" \
|
| 26 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_uart16550.v"]" \
|
| 27 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite.vh"]" \
|
| 28 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_busy.v"]" \
|
| 29 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_sdram.v"]" \
|
| 30 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_slave.v"]" \
|
| 31 |
+
"[file normalize "../../../system_rtl/mfp_clock_dividers.v"]" \
|
| 32 |
+
"[file normalize "../../../system_rtl/mfp_dual_port_ram.v"]" \
|
| 33 |
+
"[file normalize "../../../system_rtl/mfp_eic_core.v"]" \
|
| 34 |
+
"[file normalize "../../../system_rtl/mfp_eic_core.vh"]" \
|
| 35 |
+
"[file normalize "../../../system_rtl/mfp_eic_handler.v"]" \
|
| 36 |
+
"[file normalize "../../../system_rtl/mfp_pmod_als_spi_receiver.v"]" \
|
| 37 |
+
"[file normalize "../../../system_rtl/mfp_priority_encoder.v"]" \
|
| 38 |
+
"[file normalize "../../../system_rtl/mfp_register.v"]" \
|
| 39 |
+
"[file normalize "../../../system_rtl/mfp_seven_segment_displays.v"]" \
|
| 40 |
+
"[file normalize "../../../system_rtl/mfp_srec_parser_to_ahb_lite_bridge.v"]" \
|
| 41 |
+
"[file normalize "../../../system_rtl/mfp_srec_parser.v"]" \
|
| 42 |
+
"[file normalize "../../../system_rtl/mfp_switch_and_button_debouncers.v"]" \
|
| 43 |
+
"[file normalize "../../../system_rtl/mfp_system.v"]" \
|
| 44 |
+
"[file normalize "../../../system_rtl/mfp_uart_loader.v"]" \
|
| 45 |
+
"[file normalize "../../../system_rtl/mfp_uart_receiver.v"]" \
|
| 46 |
+
"[file normalize "../../../system_rtl/uart16550/raminfr.v"]" \
|
| 47 |
+
"[file normalize "../../../system_rtl/uart16550/uart_defines.vh"]" \
|
| 48 |
+
"[file normalize "../../../system_rtl/uart16550/uart_receiver.v"]" \
|
| 49 |
+
"[file normalize "../../../system_rtl/uart16550/uart_regs.v"]" \
|
| 50 |
+
"[file normalize "../../../system_rtl/uart16550/uart_rfifo.v"]" \
|
| 51 |
+
"[file normalize "../../../system_rtl/uart16550/uart_sync_flops.v"]" \
|
| 52 |
+
"[file normalize "../../../system_rtl/uart16550/uart_tfifo.v"]" \
|
| 53 |
+
"[file normalize "../../../system_rtl/uart16550/uart_transmitter.v"]" \
|
| 54 |
+
"[file normalize "../../../core/dataram_2k2way_xilinx.v"]" \
|
| 55 |
+
"[file normalize "../../../core/d_wsram_2k2way_xilinx.v"]" \
|
| 56 |
+
"[file normalize "../../../core/i_wsram_2k2way_xilinx.v"]" \
|
| 57 |
+
"[file normalize "../../../core/m14k_alu_dsp_stub.v"]" \
|
| 58 |
+
"[file normalize "../../../core/m14k_alu_shft_32bit.v"]" \
|
| 59 |
+
"[file normalize "../../../core/m14k_bistctl.v"]" \
|
| 60 |
+
"[file normalize "../../../core/m14k_biu.v"]" \
|
| 61 |
+
"[file normalize "../../../core/m14k_cache_cmp.v"]" \
|
| 62 |
+
"[file normalize "../../../core/m14k_cache_mux.v"]" \
|
| 63 |
+
"[file normalize "../../../core/m14k_cdmm_ctl.v"]" \
|
| 64 |
+
"[file normalize "../../../core/m14k_cdmm_mpustub.v"]" \
|
| 65 |
+
"[file normalize "../../../core/m14k_cdmmstub.v"]" \
|
| 66 |
+
"[file normalize "../../../core/m14k_cdmm.v"]" \
|
| 67 |
+
"[file normalize "../../../core/m14k_clockandlatch.v"]" \
|
| 68 |
+
"[file normalize "../../../core/m14k_clock_buf.v"]" \
|
| 69 |
+
"[file normalize "../../../core/m14k_clock_nogate.v"]" \
|
| 70 |
+
"[file normalize "../../../core/m14k_clockxnorgate.v"]" \
|
| 71 |
+
"[file normalize "../../../core/m14k_config.vh"]" \
|
| 72 |
+
"[file normalize "../../../core/m14k_const.vh"]" \
|
| 73 |
+
"[file normalize "../../../core/m14k_cop1_stub.v"]" \
|
| 74 |
+
"[file normalize "../../../core/m14k_cop2_stub.v"]" \
|
| 75 |
+
"[file normalize "../../../core/m14k_core.v"]" \
|
| 76 |
+
"[file normalize "../../../core/m14k_cp1_stub.v"]" \
|
| 77 |
+
"[file normalize "../../../core/m14k_cp2_stub.v"]" \
|
| 78 |
+
"[file normalize "../../../core/m14k_cpu.v"]" \
|
| 79 |
+
"[file normalize "../../../core/m14k_cpz_antitamper_stub.v"]" \
|
| 80 |
+
"[file normalize "../../../core/m14k_cpz_eicoffset_stub.v"]" \
|
| 81 |
+
"[file normalize "../../../core/m14k_cpz_guest_srs1.v"]" \
|
| 82 |
+
"[file normalize "../../../core/m14k_cpz_guest_stub.v"]" \
|
| 83 |
+
"[file normalize "../../../core/m14k_cpz_pc_top.v"]" \
|
| 84 |
+
"[file normalize "../../../core/m14k_cpz_pc.v"]" \
|
| 85 |
+
"[file normalize "../../../core/m14k_cpz_prid.v"]" \
|
| 86 |
+
"[file normalize "../../../core/m14k_cpz_root_stub.v"]" \
|
| 87 |
+
"[file normalize "../../../core/m14k_cpz_sps_stub.v"]" \
|
| 88 |
+
"[file normalize "../../../core/m14k_cpz_srs1.v"]" \
|
| 89 |
+
"[file normalize "../../../core/m14k_cpz.v"]" \
|
| 90 |
+
"[file normalize "../../../core/m14k_cpz_watch_stub.v"]" \
|
| 91 |
+
"[file normalize "../../../core/m14k_cscramble_scanio_stub.v"]" \
|
| 92 |
+
"[file normalize "../../../core/m14k_cscramble_stub.v"]" \
|
| 93 |
+
"[file normalize "../../../core/m14k_cscramble_tpl.v"]" \
|
| 94 |
+
"[file normalize "../../../core/m14k_dc_bistctl.v"]" \
|
| 95 |
+
"[file normalize "../../../core/m14k_dcc_fb.v"]" \
|
| 96 |
+
"[file normalize "../../../core/m14k_dcc_mb_stub.v"]" \
|
| 97 |
+
"[file normalize "../../../core/m14k_dcc_parity_stub.v"]" \
|
| 98 |
+
"[file normalize "../../../core/m14k_dcc_spmb_stub.v"]" \
|
| 99 |
+
"[file normalize "../../../core/m14k_dcc_spstub.v"]" \
|
| 100 |
+
"[file normalize "../../../core/m14k_dcc.v"]" \
|
| 101 |
+
"[file normalize "../../../core/m14k_dc.v"]" \
|
| 102 |
+
"[file normalize "../../../core/m14k_dsp_const.vh"]" \
|
| 103 |
+
"[file normalize "../../../core/m14k_dspram_ext_stub.v"]" \
|
| 104 |
+
"[file normalize "../../../core/m14k_edp_add_simple.v"]" \
|
| 105 |
+
"[file normalize "../../../core/m14k_edp_buf_misc_pro.v"]" \
|
| 106 |
+
"[file normalize "../../../core/m14k_edp_buf_misc.v"]" \
|
| 107 |
+
"[file normalize "../../../core/m14k_edp_clz_16b.v"]" \
|
| 108 |
+
"[file normalize "../../../core/m14k_edp_clz_4b.v"]" \
|
| 109 |
+
"[file normalize "../../../core/m14k_edp_clz.v"]" \
|
| 110 |
+
"[file normalize "../../../core/m14k_edp.v"]" \
|
| 111 |
+
"[file normalize "../../../core/m14k_ejt_and2.v"]" \
|
| 112 |
+
"[file normalize "../../../core/m14k_ejt_area.v"]" \
|
| 113 |
+
"[file normalize "../../../core/m14k_ejt_async_rec.v"]" \
|
| 114 |
+
"[file normalize "../../../core/m14k_ejt_async_snd.v"]" \
|
| 115 |
+
"[file normalize "../../../core/m14k_ejt_brk21.v"]" \
|
| 116 |
+
"[file normalize "../../../core/m14k_ejt_bus32mux2.v"]" \
|
| 117 |
+
"[file normalize "../../../core/m14k_ejt_dbrk.v"]" \
|
| 118 |
+
"[file normalize "../../../core/m14k_ejt_fifo_1r1w_stub.v"]" \
|
| 119 |
+
"[file normalize "../../../core/m14k_ejt_gate.v"]" \
|
| 120 |
+
"[file normalize "../../../core/m14k_ejt_ibrk.v"]" \
|
| 121 |
+
"[file normalize "../../../core/m14k_ejt_mux2.v"]" \
|
| 122 |
+
"[file normalize "../../../core/m14k_ejt_pdttcb_stub.v"]" \
|
| 123 |
+
"[file normalize "../../../core/m14k_ejt_tap_dasamstub.v"]" \
|
| 124 |
+
"[file normalize "../../../core/m14k_ejt_tap_dasam.v"]" \
|
| 125 |
+
"[file normalize "../../../core/m14k_ejt_tap_fdcstub.v"]" \
|
| 126 |
+
"[file normalize "../../../core/m14k_ejt_tap_fdc.v"]" \
|
| 127 |
+
"[file normalize "../../../core/m14k_ejt_tap_pcsamstub.v"]" \
|
| 128 |
+
"[file normalize "../../../core/m14k_ejt_tap_pcsam.v"]" \
|
| 129 |
+
"[file normalize "../../../core/m14k_ejt_tap.v"]" \
|
| 130 |
+
"[file normalize "../../../core/m14k_ejt_tck.v"]" \
|
| 131 |
+
"[file normalize "../../../core/m14k_ejt_tripsync.v"]" \
|
| 132 |
+
"[file normalize "../../../core/m14k_ejt.v"]" \
|
| 133 |
+
"[file normalize "../../../core/m14k_fpuclk1_nogate.v"]" \
|
| 134 |
+
"[file normalize "../../../core/m14k_gf_mux2.v"]" \
|
| 135 |
+
"[file normalize "../../../core/m14k_glue.v"]" \
|
| 136 |
+
"[file normalize "../../../core/m14k_ic_bistctl.v"]" \
|
| 137 |
+
"[file normalize "../../../core/m14k_icc_mb_stub.v"]" \
|
| 138 |
+
"[file normalize "../../../core/m14k_icc_parity_stub.v"]" \
|
| 139 |
+
"[file normalize "../../../core/m14k_icc_spmb_stub.v"]" \
|
| 140 |
+
"[file normalize "../../../core/m14k_icc_spstub.v"]" \
|
| 141 |
+
"[file normalize "../../../core/m14k_icc_umips_stub.v"]" \
|
| 142 |
+
"[file normalize "../../../core/m14k_icc.v"]" \
|
| 143 |
+
"[file normalize "../../../core/m14k_ic.v"]" \
|
| 144 |
+
"[file normalize "../../../core/m14k_ispram_ext_stub.v"]" \
|
| 145 |
+
"[file normalize "../../../core/m14k_mdl_add_simple.v"]" \
|
| 146 |
+
"[file normalize "../../../core/m14k_mdl_ctl.v"]" \
|
| 147 |
+
"[file normalize "../../../core/m14k_mdl_dp.v"]" \
|
| 148 |
+
"[file normalize "../../../core/m14k_mdl.v"]" \
|
| 149 |
+
"[file normalize "../../../core/m14k_mmuc.v"]" \
|
| 150 |
+
"[file normalize "../../../core/m14k_mmu.vh"]" \
|
| 151 |
+
"[file normalize "../../../core/m14k_mpc_ctl.v"]" \
|
| 152 |
+
"[file normalize "../../../core/m14k_mpc_dec.v"]" \
|
| 153 |
+
"[file normalize "../../../core/m14k_mpc_exc.v"]" \
|
| 154 |
+
"[file normalize "../../../core/m14k_mpc.v"]" \
|
| 155 |
+
"[file normalize "../../../core/m14k_rf_reg.v"]" \
|
| 156 |
+
"[file normalize "../../../core/m14k_rf_rngc.v"]" \
|
| 157 |
+
"[file normalize "../../../core/m14k_rf_stub.v"]" \
|
| 158 |
+
"[file normalize "../../../core/m14k_siu_int_sync.v"]" \
|
| 159 |
+
"[file normalize "../../../core/m14k_siu.v"]" \
|
| 160 |
+
"[file normalize "../../../core/m14k_spram_top.v"]" \
|
| 161 |
+
"[file normalize "../../../core/m14k_tlb_collector.v"]" \
|
| 162 |
+
"[file normalize "../../../core/m14k_tlb_cpy.v"]" \
|
| 163 |
+
"[file normalize "../../../core/m14k_tlb_ctl.v"]" \
|
| 164 |
+
"[file normalize "../../../core/m14k_tlb_dtlb.v"]" \
|
| 165 |
+
"[file normalize "../../../core/m14k_tlb_itlb.v"]" \
|
| 166 |
+
"[file normalize "../../../core/m14k_tlb_jtlb16entries.v"]" \
|
| 167 |
+
"[file normalize "../../../core/m14k_tlb_jtlb16.v"]" \
|
| 168 |
+
"[file normalize "../../../core/m14k_tlb_jtlb1entry.v"]" \
|
| 169 |
+
"[file normalize "../../../core/m14k_tlb_jtlb4entries.v"]" \
|
| 170 |
+
"[file normalize "../../../core/m14k_tlb_utlbentry.v"]" \
|
| 171 |
+
"[file normalize "../../../core/m14k_tlb_utlb.v"]" \
|
| 172 |
+
"[file normalize "../../../core/m14k_tlb.v"]" \
|
| 173 |
+
"[file normalize "../../../core/m14k_top.v"]" \
|
| 174 |
+
"[file normalize "../../../core/m14k_udi_custom.v"]" \
|
| 175 |
+
"[file normalize "../../../core/m14k_udi_scanio_stub.v"]" \
|
| 176 |
+
"[file normalize "../../../core/m14k_udi_stub.v"]" \
|
| 177 |
+
"[file normalize "../../../core/mvp_cregister_c.v"]" \
|
| 178 |
+
"[file normalize "../../../core/mvp_cregister_ngc.v"]" \
|
| 179 |
+
"[file normalize "../../../core/mvp_cregister_s.v"]" \
|
| 180 |
+
"[file normalize "../../../core/mvp_cregister.v"]" \
|
| 181 |
+
"[file normalize "../../../core/mvp_cregister_wide_tlb.v"]" \
|
| 182 |
+
"[file normalize "../../../core/mvp_cregister_wide_utlb.v"]" \
|
| 183 |
+
"[file normalize "../../../core/mvp_cregister_wide.v"]" \
|
| 184 |
+
"[file normalize "../../../core/mvp_latchn.v"]" \
|
| 185 |
+
"[file normalize "../../../core/mvp_mux16.v"]" \
|
| 186 |
+
"[file normalize "../../../core/mvp_mux1hot_10.v"]" \
|
| 187 |
+
"[file normalize "../../../core/mvp_mux1hot_13.v"]" \
|
| 188 |
+
"[file normalize "../../../core/mvp_mux1hot_24.v"]" \
|
| 189 |
+
"[file normalize "../../../core/mvp_mux1hot_3.v"]" \
|
| 190 |
+
"[file normalize "../../../core/mvp_mux1hot_4.v"]" \
|
| 191 |
+
"[file normalize "../../../core/mvp_mux1hot_5.v"]" \
|
| 192 |
+
"[file normalize "../../../core/mvp_mux1hot_6.v"]" \
|
| 193 |
+
"[file normalize "../../../core/mvp_mux1hot_8.v"]" \
|
| 194 |
+
"[file normalize "../../../core/mvp_mux1hot_9.v"]" \
|
| 195 |
+
"[file normalize "../../../core/mvp_mux2.v"]" \
|
| 196 |
+
"[file normalize "../../../core/mvp_mux4.v"]" \
|
| 197 |
+
"[file normalize "../../../core/mvp_mux8.v"]" \
|
| 198 |
+
"[file normalize "../../../core/mvp_register_c.v"]" \
|
| 199 |
+
"[file normalize "../../../core/mvp_register_ngc.v"]" \
|
| 200 |
+
"[file normalize "../../../core/mvp_register_s.v"]" \
|
| 201 |
+
"[file normalize "../../../core/mvp_register.v"]" \
|
| 202 |
+
"[file normalize "../../../core/mvp_ucregister_wide.v"]" \
|
| 203 |
+
"[file normalize "../../../core/RAMB4K_S16.v"]" \
|
| 204 |
+
"[file normalize "../../../core/RAMB4K_S2.v"]" \
|
| 205 |
+
"[file normalize "../../../core/RAMB4K_S8.v"]" \
|
| 206 |
+
"[file normalize "../../../core/ram_dual_port.v"]" \
|
| 207 |
+
"[file normalize "../../../core/ram_reset_dual_port.v"]" \
|
| 208 |
+
"[file normalize "../../../core/tagram_2k2way_xilinx.v"]" \
|
| 209 |
+
]
|
| 210 |
+
|
| 211 |
+
set constr_files [list \
|
| 212 |
+
"[file normalize "../nexys4.xdc"]" \
|
| 213 |
+
]
|
| 214 |
+
|
| 215 |
+
set sim_files [list \
|
| 216 |
+
"[file normalize "../../../testbench/sdr_sdram"]" \
|
| 217 |
+
"[file normalize "../../../testbench/sdr_sdram/sdr.v"]" \
|
| 218 |
+
"[file normalize "../../../testbench/sdr_sdram/sdr_parameters.vh"]" \
|
| 219 |
+
"[file normalize "../../../testbench/mfp_testbench.v"]" \
|
| 220 |
+
"[file normalize "../../../testbench/mfp_uart_testbench.v"]" \
|
| 221 |
+
]
|
| 222 |
+
|
| 223 |
+
# create project
|
| 224 |
+
create_project $project_name $project_path -part $project_part -force
|
| 225 |
+
|
| 226 |
+
# fill 'sources_1' fileset
|
| 227 |
+
if {[info exists source_files]} {
|
| 228 |
+
add_files -norecurse -fileset [get_filesets sources_1] $source_files
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
# fill 'constrs_1' fileset
|
| 232 |
+
if {[info exists constr_files]} {
|
| 233 |
+
add_files -norecurse -fileset [get_filesets constrs_1] $constr_files
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
# fill 'sim_1' fileset
|
| 237 |
+
if {[info exists sim_files]} {
|
| 238 |
+
set obj [get_filesets sim_1]
|
| 239 |
+
add_files -norecurse -fileset $obj $sim_files
|
| 240 |
+
set_property top $testbench_top $obj
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
# define macros VIVADO_SYNTHESIS
|
| 244 |
+
set_property -name {STEPS.SYNTH_DESIGN.ARGS.MORE OPTIONS} -value {-verilog_define VIVADO_SYNTHESIS} -objects [get_runs synth_1]
|
| 245 |
+
|
| 246 |
+
puts "INFO: Project created:$project_name"
|
MIPSfpga_mipsfpga-plus/boards/nexys4/system_load.tcl
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
set project_name "system"
|
| 3 |
+
set hw_device "xc7a100t_0"
|
| 4 |
+
|
| 5 |
+
open_project "$project_name.xpr"; # open Vivado project
|
| 6 |
+
open_hw; # open the Hardware Manager
|
| 7 |
+
connect_hw_server; # open a connection to a hardware server
|
| 8 |
+
open_hw_target; # connect to the board
|
| 9 |
+
|
| 10 |
+
# set a file to be programmed
|
| 11 |
+
set_property PROGRAM.FILE "$project_name.bit" [get_hw_devices $hw_device];
|
| 12 |
+
|
| 13 |
+
# chip programming
|
| 14 |
+
program_hw_devices [get_hw_devices $hw_device]
|
| 15 |
+
#refresh_hw_device -update_hw_probes false [lindex [get_hw_devices $hw_device] 0]
|
| 16 |
+
|
| 17 |
+
# connections and project closing
|
| 18 |
+
close_hw_target
|
| 19 |
+
disconnect_hw_server
|
| 20 |
+
close_hw
|
| 21 |
+
close_project
|
MIPSfpga_mipsfpga-plus/boards/nexys4/system_synth.tcl
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
set project_name "system"
|
| 3 |
+
set synth_task "synth_1"
|
| 4 |
+
set impl_task "impl_1"
|
| 5 |
+
set timing_report "timing_1"
|
| 6 |
+
|
| 7 |
+
open_project "$project_name.xpr"
|
| 8 |
+
|
| 9 |
+
# run synthesis
|
| 10 |
+
launch_runs $synth_task
|
| 11 |
+
wait_on_run -verbose $synth_task
|
| 12 |
+
|
| 13 |
+
# run implementation
|
| 14 |
+
launch_runs $impl_task
|
| 15 |
+
wait_on_run -verbose $impl_task
|
| 16 |
+
|
| 17 |
+
# write bitstream
|
| 18 |
+
open_run $impl_task -name $impl_task
|
| 19 |
+
write_bitstream "$project_name.bit"
|
MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/nexys4_ddr.v
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`include "mfp_ahb_lite_matrix_config.vh"
|
| 2 |
+
|
| 3 |
+
module nexys4_ddr
|
| 4 |
+
(
|
| 5 |
+
input CLK100MHZ,
|
| 6 |
+
input CPU_RESETN,
|
| 7 |
+
|
| 8 |
+
input BTNC,
|
| 9 |
+
input BTNU,
|
| 10 |
+
input BTNL,
|
| 11 |
+
input BTNR,
|
| 12 |
+
input BTND,
|
| 13 |
+
|
| 14 |
+
input [15:0] SW,
|
| 15 |
+
|
| 16 |
+
output [15:0] LED,
|
| 17 |
+
|
| 18 |
+
output LED16_B,
|
| 19 |
+
output LED16_G,
|
| 20 |
+
output LED16_R,
|
| 21 |
+
output LED17_B,
|
| 22 |
+
output LED17_G,
|
| 23 |
+
output LED17_R,
|
| 24 |
+
|
| 25 |
+
output CA,
|
| 26 |
+
output CB,
|
| 27 |
+
output CC,
|
| 28 |
+
output CD,
|
| 29 |
+
output CE,
|
| 30 |
+
output CF,
|
| 31 |
+
output CG,
|
| 32 |
+
output DP,
|
| 33 |
+
|
| 34 |
+
output [ 7:0] AN,
|
| 35 |
+
|
| 36 |
+
inout [12:1] JA,
|
| 37 |
+
inout [12:1] JB,
|
| 38 |
+
|
| 39 |
+
input UART_TXD_IN
|
| 40 |
+
);
|
| 41 |
+
|
| 42 |
+
wire clk;
|
| 43 |
+
|
| 44 |
+
`define MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 45 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 46 |
+
|
| 47 |
+
wire muxed_clk;
|
| 48 |
+
wire [1:0] sw_db;
|
| 49 |
+
|
| 50 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 51 |
+
# (.WIDTH (2))
|
| 52 |
+
mfp_multi_switch_or_button_sync_and_debouncer
|
| 53 |
+
(
|
| 54 |
+
.clk ( CLK100MHZ ),
|
| 55 |
+
.sw_in ( SW [1:0] ),
|
| 56 |
+
.sw_out ( sw_db )
|
| 57 |
+
);
|
| 58 |
+
|
| 59 |
+
mfp_clock_divider_100_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 60 |
+
mfp_clock_divider_100_MHz_to_25_MHz_12_Hz_0_75_Hz
|
| 61 |
+
(
|
| 62 |
+
.clki ( CLK100MHZ ),
|
| 63 |
+
.sel_lo ( sw_db [0] ),
|
| 64 |
+
.sel_mid ( sw_db [1] ),
|
| 65 |
+
.clko ( muxed_clk )
|
| 66 |
+
);
|
| 67 |
+
|
| 68 |
+
BUFG BUFG_slow_clk (.O ( clk ), .I ( muxed_clk ));
|
| 69 |
+
|
| 70 |
+
`else
|
| 71 |
+
|
| 72 |
+
clk_wiz_0 clk_wiz_0 (.clk_in1 (CLK100MHZ), .clk_out1 (clk));
|
| 73 |
+
|
| 74 |
+
`endif
|
| 75 |
+
|
| 76 |
+
wire [`MFP_N_SWITCHES - 1:0] IO_Switches;
|
| 77 |
+
wire [`MFP_N_BUTTONS - 1:0] IO_Buttons;
|
| 78 |
+
wire [`MFP_N_RED_LEDS - 1:0] IO_RedLEDs;
|
| 79 |
+
wire [`MFP_N_GREEN_LEDS - 1:0] IO_GreenLEDs;
|
| 80 |
+
wire [`MFP_7_SEGMENT_HEX_WIDTH - 1:0] IO_7_SegmentHEX;
|
| 81 |
+
|
| 82 |
+
assign IO_Switches = { { `MFP_N_SWITCHES - 16 { 1'b0 } } , SW [15:0] };
|
| 83 |
+
|
| 84 |
+
assign IO_Buttons = { { `MFP_N_BUTTONS - 5 { 1'b0 } } ,
|
| 85 |
+
BTNU, BTND, BTNL, BTNC, BTNR };
|
| 86 |
+
|
| 87 |
+
`ifdef MFP_USE_SLOW_CLOCK_AND_CLOCK_MUX
|
| 88 |
+
assign LED = (sw_db == 2'b00 ? IO_RedLEDs [15:0] : IO_GreenLEDs [15:0]);
|
| 89 |
+
`else
|
| 90 |
+
assign LED = IO_RedLEDs [15:0];
|
| 91 |
+
`endif
|
| 92 |
+
|
| 93 |
+
assign LED16_B = 1'b0;
|
| 94 |
+
assign LED16_G = 1'b0;
|
| 95 |
+
assign LED16_R = 1'b0;
|
| 96 |
+
assign LED17_B = 1'b0;
|
| 97 |
+
assign LED17_G = 1'b0;
|
| 98 |
+
assign LED17_R = 1'b0;
|
| 99 |
+
|
| 100 |
+
wire [31:0] HADDR, HRDATA, HWDATA;
|
| 101 |
+
wire HWRITE;
|
| 102 |
+
|
| 103 |
+
wire ejtag_tck_in, ejtag_tck;
|
| 104 |
+
|
| 105 |
+
IBUF IBUF (.O ( ejtag_tck_in ), .I ( JB [4] ));
|
| 106 |
+
BUFG BUFG_ejtag_tck (.O ( ejtag_tck ), .I ( ejtag_tck_in ));
|
| 107 |
+
|
| 108 |
+
mfp_system mfp_system
|
| 109 |
+
(
|
| 110 |
+
.SI_ClkIn ( clk ),
|
| 111 |
+
.SI_Reset ( ~ CPU_RESETN ),
|
| 112 |
+
|
| 113 |
+
.HADDR ( HADDR ),
|
| 114 |
+
.HRDATA ( HRDATA ),
|
| 115 |
+
.HWDATA ( HWDATA ),
|
| 116 |
+
.HWRITE ( HWRITE ),
|
| 117 |
+
|
| 118 |
+
.EJ_TRST_N_probe ( JB [7] ),
|
| 119 |
+
.EJ_TDI ( JB [2] ),
|
| 120 |
+
.EJ_TDO ( JB [3] ),
|
| 121 |
+
.EJ_TMS ( JB [1] ),
|
| 122 |
+
.EJ_TCK ( ejtag_tck_in ),
|
| 123 |
+
.SI_ColdReset ( ~ JB [8] ),
|
| 124 |
+
.EJ_DINT ( 1'b0 ),
|
| 125 |
+
|
| 126 |
+
.IO_Switches ( IO_Switches ),
|
| 127 |
+
.IO_Buttons ( IO_Buttons ),
|
| 128 |
+
.IO_RedLEDs ( IO_RedLEDs ),
|
| 129 |
+
.IO_GreenLEDs ( IO_GreenLEDs ),
|
| 130 |
+
.IO_7_SegmentHEX ( IO_7_SegmentHEX ),
|
| 131 |
+
|
| 132 |
+
.UART_RX ( UART_TXD_IN /* Alternative: JA [10] */ ),
|
| 133 |
+
.UART_TX ( /* TODO */ ),
|
| 134 |
+
|
| 135 |
+
.SPI_CS ( JA [ 1] ),
|
| 136 |
+
.SPI_SCK ( JA [ 4] ),
|
| 137 |
+
.SPI_SDO ( JA [ 3] )
|
| 138 |
+
);
|
| 139 |
+
|
| 140 |
+
assign JA [7] = 1'b0;
|
| 141 |
+
|
| 142 |
+
wire display_clock;
|
| 143 |
+
|
| 144 |
+
mfp_clock_divider_100_MHz_to_763_Hz mfp_clock_divider_100_MHz_to_763_Hz
|
| 145 |
+
(CLK100MHZ, display_clock);
|
| 146 |
+
|
| 147 |
+
mfp_multi_digit_display multi_digit_display
|
| 148 |
+
(
|
| 149 |
+
.clock ( display_clock ),
|
| 150 |
+
.resetn ( CPU_RESETN ),
|
| 151 |
+
.number ( IO_7_SegmentHEX ),
|
| 152 |
+
|
| 153 |
+
.seven_segments ( { CG, CF, CE, CD, CC, CB, CA } ),
|
| 154 |
+
.dot ( DP ),
|
| 155 |
+
.anodes ( AN )
|
| 156 |
+
);
|
| 157 |
+
|
| 158 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/system_create.tcl
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# path where project will be created
|
| 3 |
+
set project_path [pwd]
|
| 4 |
+
set script_path [file dirname [file normalize [info script]]]
|
| 5 |
+
|
| 6 |
+
# global settings
|
| 7 |
+
set project_name "system"
|
| 8 |
+
set project_part "xc7a100tcsg324-1"
|
| 9 |
+
set testbench_top "mfp_testbench"
|
| 10 |
+
|
| 11 |
+
# source files path
|
| 12 |
+
set rtl_path $project_path/../rtl
|
| 13 |
+
set tb_path $project_path/../tb
|
| 14 |
+
|
| 15 |
+
# project local settings
|
| 16 |
+
set source_files [list \
|
| 17 |
+
"[file normalize "../nexys4_ddr.v"]" \
|
| 18 |
+
"[file normalize "../../../system_rtl/mfp_ahb_gpio_slave.v"]" \
|
| 19 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_adc_max10.v"]" \
|
| 20 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_eic.v"]" \
|
| 21 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix_config.vh"]" \
|
| 22 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix.v"]" \
|
| 23 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_matrix_with_loader.v"]" \
|
| 24 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_pmod_als.v"]" \
|
| 25 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_slave.v"]" \
|
| 26 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite_uart16550.v"]" \
|
| 27 |
+
"[file normalize "../../../system_rtl/mfp_ahb_lite.vh"]" \
|
| 28 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_busy.v"]" \
|
| 29 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_sdram.v"]" \
|
| 30 |
+
"[file normalize "../../../system_rtl/mfp_ahb_ram_slave.v"]" \
|
| 31 |
+
"[file normalize "../../../system_rtl/mfp_clock_dividers.v"]" \
|
| 32 |
+
"[file normalize "../../../system_rtl/mfp_dual_port_ram.v"]" \
|
| 33 |
+
"[file normalize "../../../system_rtl/mfp_eic_core.v"]" \
|
| 34 |
+
"[file normalize "../../../system_rtl/mfp_eic_core.vh"]" \
|
| 35 |
+
"[file normalize "../../../system_rtl/mfp_eic_handler.v"]" \
|
| 36 |
+
"[file normalize "../../../system_rtl/mfp_pmod_als_spi_receiver.v"]" \
|
| 37 |
+
"[file normalize "../../../system_rtl/mfp_priority_encoder.v"]" \
|
| 38 |
+
"[file normalize "../../../system_rtl/mfp_register.v"]" \
|
| 39 |
+
"[file normalize "../../../system_rtl/mfp_seven_segment_displays.v"]" \
|
| 40 |
+
"[file normalize "../../../system_rtl/mfp_srec_parser_to_ahb_lite_bridge.v"]" \
|
| 41 |
+
"[file normalize "../../../system_rtl/mfp_srec_parser.v"]" \
|
| 42 |
+
"[file normalize "../../../system_rtl/mfp_switch_and_button_debouncers.v"]" \
|
| 43 |
+
"[file normalize "../../../system_rtl/mfp_system.v"]" \
|
| 44 |
+
"[file normalize "../../../system_rtl/mfp_uart_loader.v"]" \
|
| 45 |
+
"[file normalize "../../../system_rtl/mfp_uart_receiver.v"]" \
|
| 46 |
+
"[file normalize "../../../system_rtl/uart16550/raminfr.v"]" \
|
| 47 |
+
"[file normalize "../../../system_rtl/uart16550/uart_defines.vh"]" \
|
| 48 |
+
"[file normalize "../../../system_rtl/uart16550/uart_receiver.v"]" \
|
| 49 |
+
"[file normalize "../../../system_rtl/uart16550/uart_regs.v"]" \
|
| 50 |
+
"[file normalize "../../../system_rtl/uart16550/uart_rfifo.v"]" \
|
| 51 |
+
"[file normalize "../../../system_rtl/uart16550/uart_sync_flops.v"]" \
|
| 52 |
+
"[file normalize "../../../system_rtl/uart16550/uart_tfifo.v"]" \
|
| 53 |
+
"[file normalize "../../../system_rtl/uart16550/uart_transmitter.v"]" \
|
| 54 |
+
"[file normalize "../../../core/dataram_2k2way_xilinx.v"]" \
|
| 55 |
+
"[file normalize "../../../core/d_wsram_2k2way_xilinx.v"]" \
|
| 56 |
+
"[file normalize "../../../core/i_wsram_2k2way_xilinx.v"]" \
|
| 57 |
+
"[file normalize "../../../core/m14k_alu_dsp_stub.v"]" \
|
| 58 |
+
"[file normalize "../../../core/m14k_alu_shft_32bit.v"]" \
|
| 59 |
+
"[file normalize "../../../core/m14k_bistctl.v"]" \
|
| 60 |
+
"[file normalize "../../../core/m14k_biu.v"]" \
|
| 61 |
+
"[file normalize "../../../core/m14k_cache_cmp.v"]" \
|
| 62 |
+
"[file normalize "../../../core/m14k_cache_mux.v"]" \
|
| 63 |
+
"[file normalize "../../../core/m14k_cdmm_ctl.v"]" \
|
| 64 |
+
"[file normalize "../../../core/m14k_cdmm_mpustub.v"]" \
|
| 65 |
+
"[file normalize "../../../core/m14k_cdmmstub.v"]" \
|
| 66 |
+
"[file normalize "../../../core/m14k_cdmm.v"]" \
|
| 67 |
+
"[file normalize "../../../core/m14k_clockandlatch.v"]" \
|
| 68 |
+
"[file normalize "../../../core/m14k_clock_buf.v"]" \
|
| 69 |
+
"[file normalize "../../../core/m14k_clock_nogate.v"]" \
|
| 70 |
+
"[file normalize "../../../core/m14k_clockxnorgate.v"]" \
|
| 71 |
+
"[file normalize "../../../core/m14k_config.vh"]" \
|
| 72 |
+
"[file normalize "../../../core/m14k_const.vh"]" \
|
| 73 |
+
"[file normalize "../../../core/m14k_cop1_stub.v"]" \
|
| 74 |
+
"[file normalize "../../../core/m14k_cop2_stub.v"]" \
|
| 75 |
+
"[file normalize "../../../core/m14k_core.v"]" \
|
| 76 |
+
"[file normalize "../../../core/m14k_cp1_stub.v"]" \
|
| 77 |
+
"[file normalize "../../../core/m14k_cp2_stub.v"]" \
|
| 78 |
+
"[file normalize "../../../core/m14k_cpu.v"]" \
|
| 79 |
+
"[file normalize "../../../core/m14k_cpz_antitamper_stub.v"]" \
|
| 80 |
+
"[file normalize "../../../core/m14k_cpz_eicoffset_stub.v"]" \
|
| 81 |
+
"[file normalize "../../../core/m14k_cpz_guest_srs1.v"]" \
|
| 82 |
+
"[file normalize "../../../core/m14k_cpz_guest_stub.v"]" \
|
| 83 |
+
"[file normalize "../../../core/m14k_cpz_pc_top.v"]" \
|
| 84 |
+
"[file normalize "../../../core/m14k_cpz_pc.v"]" \
|
| 85 |
+
"[file normalize "../../../core/m14k_cpz_prid.v"]" \
|
| 86 |
+
"[file normalize "../../../core/m14k_cpz_root_stub.v"]" \
|
| 87 |
+
"[file normalize "../../../core/m14k_cpz_sps_stub.v"]" \
|
| 88 |
+
"[file normalize "../../../core/m14k_cpz_srs1.v"]" \
|
| 89 |
+
"[file normalize "../../../core/m14k_cpz.v"]" \
|
| 90 |
+
"[file normalize "../../../core/m14k_cpz_watch_stub.v"]" \
|
| 91 |
+
"[file normalize "../../../core/m14k_cscramble_scanio_stub.v"]" \
|
| 92 |
+
"[file normalize "../../../core/m14k_cscramble_stub.v"]" \
|
| 93 |
+
"[file normalize "../../../core/m14k_cscramble_tpl.v"]" \
|
| 94 |
+
"[file normalize "../../../core/m14k_dc_bistctl.v"]" \
|
| 95 |
+
"[file normalize "../../../core/m14k_dcc_fb.v"]" \
|
| 96 |
+
"[file normalize "../../../core/m14k_dcc_mb_stub.v"]" \
|
| 97 |
+
"[file normalize "../../../core/m14k_dcc_parity_stub.v"]" \
|
| 98 |
+
"[file normalize "../../../core/m14k_dcc_spmb_stub.v"]" \
|
| 99 |
+
"[file normalize "../../../core/m14k_dcc_spstub.v"]" \
|
| 100 |
+
"[file normalize "../../../core/m14k_dcc.v"]" \
|
| 101 |
+
"[file normalize "../../../core/m14k_dc.v"]" \
|
| 102 |
+
"[file normalize "../../../core/m14k_dsp_const.vh"]" \
|
| 103 |
+
"[file normalize "../../../core/m14k_dspram_ext_stub.v"]" \
|
| 104 |
+
"[file normalize "../../../core/m14k_edp_add_simple.v"]" \
|
| 105 |
+
"[file normalize "../../../core/m14k_edp_buf_misc_pro.v"]" \
|
| 106 |
+
"[file normalize "../../../core/m14k_edp_buf_misc.v"]" \
|
| 107 |
+
"[file normalize "../../../core/m14k_edp_clz_16b.v"]" \
|
| 108 |
+
"[file normalize "../../../core/m14k_edp_clz_4b.v"]" \
|
| 109 |
+
"[file normalize "../../../core/m14k_edp_clz.v"]" \
|
| 110 |
+
"[file normalize "../../../core/m14k_edp.v"]" \
|
| 111 |
+
"[file normalize "../../../core/m14k_ejt_and2.v"]" \
|
| 112 |
+
"[file normalize "../../../core/m14k_ejt_area.v"]" \
|
| 113 |
+
"[file normalize "../../../core/m14k_ejt_async_rec.v"]" \
|
| 114 |
+
"[file normalize "../../../core/m14k_ejt_async_snd.v"]" \
|
| 115 |
+
"[file normalize "../../../core/m14k_ejt_brk21.v"]" \
|
| 116 |
+
"[file normalize "../../../core/m14k_ejt_bus32mux2.v"]" \
|
| 117 |
+
"[file normalize "../../../core/m14k_ejt_dbrk.v"]" \
|
| 118 |
+
"[file normalize "../../../core/m14k_ejt_fifo_1r1w_stub.v"]" \
|
| 119 |
+
"[file normalize "../../../core/m14k_ejt_gate.v"]" \
|
| 120 |
+
"[file normalize "../../../core/m14k_ejt_ibrk.v"]" \
|
| 121 |
+
"[file normalize "../../../core/m14k_ejt_mux2.v"]" \
|
| 122 |
+
"[file normalize "../../../core/m14k_ejt_pdttcb_stub.v"]" \
|
| 123 |
+
"[file normalize "../../../core/m14k_ejt_tap_dasamstub.v"]" \
|
| 124 |
+
"[file normalize "../../../core/m14k_ejt_tap_dasam.v"]" \
|
| 125 |
+
"[file normalize "../../../core/m14k_ejt_tap_fdcstub.v"]" \
|
| 126 |
+
"[file normalize "../../../core/m14k_ejt_tap_fdc.v"]" \
|
| 127 |
+
"[file normalize "../../../core/m14k_ejt_tap_pcsamstub.v"]" \
|
| 128 |
+
"[file normalize "../../../core/m14k_ejt_tap_pcsam.v"]" \
|
| 129 |
+
"[file normalize "../../../core/m14k_ejt_tap.v"]" \
|
| 130 |
+
"[file normalize "../../../core/m14k_ejt_tck.v"]" \
|
| 131 |
+
"[file normalize "../../../core/m14k_ejt_tripsync.v"]" \
|
| 132 |
+
"[file normalize "../../../core/m14k_ejt.v"]" \
|
| 133 |
+
"[file normalize "../../../core/m14k_fpuclk1_nogate.v"]" \
|
| 134 |
+
"[file normalize "../../../core/m14k_gf_mux2.v"]" \
|
| 135 |
+
"[file normalize "../../../core/m14k_glue.v"]" \
|
| 136 |
+
"[file normalize "../../../core/m14k_ic_bistctl.v"]" \
|
| 137 |
+
"[file normalize "../../../core/m14k_icc_mb_stub.v"]" \
|
| 138 |
+
"[file normalize "../../../core/m14k_icc_parity_stub.v"]" \
|
| 139 |
+
"[file normalize "../../../core/m14k_icc_spmb_stub.v"]" \
|
| 140 |
+
"[file normalize "../../../core/m14k_icc_spstub.v"]" \
|
| 141 |
+
"[file normalize "../../../core/m14k_icc_umips_stub.v"]" \
|
| 142 |
+
"[file normalize "../../../core/m14k_icc.v"]" \
|
| 143 |
+
"[file normalize "../../../core/m14k_ic.v"]" \
|
| 144 |
+
"[file normalize "../../../core/m14k_ispram_ext_stub.v"]" \
|
| 145 |
+
"[file normalize "../../../core/m14k_mdl_add_simple.v"]" \
|
| 146 |
+
"[file normalize "../../../core/m14k_mdl_ctl.v"]" \
|
| 147 |
+
"[file normalize "../../../core/m14k_mdl_dp.v"]" \
|
| 148 |
+
"[file normalize "../../../core/m14k_mdl.v"]" \
|
| 149 |
+
"[file normalize "../../../core/m14k_mmuc.v"]" \
|
| 150 |
+
"[file normalize "../../../core/m14k_mmu.vh"]" \
|
| 151 |
+
"[file normalize "../../../core/m14k_mpc_ctl.v"]" \
|
| 152 |
+
"[file normalize "../../../core/m14k_mpc_dec.v"]" \
|
| 153 |
+
"[file normalize "../../../core/m14k_mpc_exc.v"]" \
|
| 154 |
+
"[file normalize "../../../core/m14k_mpc.v"]" \
|
| 155 |
+
"[file normalize "../../../core/m14k_rf_reg.v"]" \
|
| 156 |
+
"[file normalize "../../../core/m14k_rf_rngc.v"]" \
|
| 157 |
+
"[file normalize "../../../core/m14k_rf_stub.v"]" \
|
| 158 |
+
"[file normalize "../../../core/m14k_siu_int_sync.v"]" \
|
| 159 |
+
"[file normalize "../../../core/m14k_siu.v"]" \
|
| 160 |
+
"[file normalize "../../../core/m14k_spram_top.v"]" \
|
| 161 |
+
"[file normalize "../../../core/m14k_tlb_collector.v"]" \
|
| 162 |
+
"[file normalize "../../../core/m14k_tlb_cpy.v"]" \
|
| 163 |
+
"[file normalize "../../../core/m14k_tlb_ctl.v"]" \
|
| 164 |
+
"[file normalize "../../../core/m14k_tlb_dtlb.v"]" \
|
| 165 |
+
"[file normalize "../../../core/m14k_tlb_itlb.v"]" \
|
| 166 |
+
"[file normalize "../../../core/m14k_tlb_jtlb16entries.v"]" \
|
| 167 |
+
"[file normalize "../../../core/m14k_tlb_jtlb16.v"]" \
|
| 168 |
+
"[file normalize "../../../core/m14k_tlb_jtlb1entry.v"]" \
|
| 169 |
+
"[file normalize "../../../core/m14k_tlb_jtlb4entries.v"]" \
|
| 170 |
+
"[file normalize "../../../core/m14k_tlb_utlbentry.v"]" \
|
| 171 |
+
"[file normalize "../../../core/m14k_tlb_utlb.v"]" \
|
| 172 |
+
"[file normalize "../../../core/m14k_tlb.v"]" \
|
| 173 |
+
"[file normalize "../../../core/m14k_top.v"]" \
|
| 174 |
+
"[file normalize "../../../core/m14k_udi_mipsfpga_ai.v"]" \
|
| 175 |
+
"[file normalize "../../../core/m14k_udi_scanio_stub.v"]" \
|
| 176 |
+
"[file normalize "../../../core/m14k_udi_stub.v"]" \
|
| 177 |
+
"[file normalize "../../../core/mvp_cregister_c.v"]" \
|
| 178 |
+
"[file normalize "../../../core/mvp_cregister_ngc.v"]" \
|
| 179 |
+
"[file normalize "../../../core/mvp_cregister_s.v"]" \
|
| 180 |
+
"[file normalize "../../../core/mvp_cregister.v"]" \
|
| 181 |
+
"[file normalize "../../../core/mvp_cregister_wide_tlb.v"]" \
|
| 182 |
+
"[file normalize "../../../core/mvp_cregister_wide_utlb.v"]" \
|
| 183 |
+
"[file normalize "../../../core/mvp_cregister_wide.v"]" \
|
| 184 |
+
"[file normalize "../../../core/mvp_latchn.v"]" \
|
| 185 |
+
"[file normalize "../../../core/mvp_mux16.v"]" \
|
| 186 |
+
"[file normalize "../../../core/mvp_mux1hot_10.v"]" \
|
| 187 |
+
"[file normalize "../../../core/mvp_mux1hot_13.v"]" \
|
| 188 |
+
"[file normalize "../../../core/mvp_mux1hot_24.v"]" \
|
| 189 |
+
"[file normalize "../../../core/mvp_mux1hot_3.v"]" \
|
| 190 |
+
"[file normalize "../../../core/mvp_mux1hot_4.v"]" \
|
| 191 |
+
"[file normalize "../../../core/mvp_mux1hot_5.v"]" \
|
| 192 |
+
"[file normalize "../../../core/mvp_mux1hot_6.v"]" \
|
| 193 |
+
"[file normalize "../../../core/mvp_mux1hot_8.v"]" \
|
| 194 |
+
"[file normalize "../../../core/mvp_mux1hot_9.v"]" \
|
| 195 |
+
"[file normalize "../../../core/mvp_mux2.v"]" \
|
| 196 |
+
"[file normalize "../../../core/mvp_mux4.v"]" \
|
| 197 |
+
"[file normalize "../../../core/mvp_mux8.v"]" \
|
| 198 |
+
"[file normalize "../../../core/mvp_register_c.v"]" \
|
| 199 |
+
"[file normalize "../../../core/mvp_register_ngc.v"]" \
|
| 200 |
+
"[file normalize "../../../core/mvp_register_s.v"]" \
|
| 201 |
+
"[file normalize "../../../core/mvp_register.v"]" \
|
| 202 |
+
"[file normalize "../../../core/mvp_ucregister_wide.v"]" \
|
| 203 |
+
"[file normalize "../../../core/RAMB4K_S16.v"]" \
|
| 204 |
+
"[file normalize "../../../core/RAMB4K_S2.v"]" \
|
| 205 |
+
"[file normalize "../../../core/RAMB4K_S8.v"]" \
|
| 206 |
+
"[file normalize "../../../core/ram_dual_port.v"]" \
|
| 207 |
+
"[file normalize "../../../core/ram_reset_dual_port.v"]" \
|
| 208 |
+
"[file normalize "../../../core/tagram_2k2way_xilinx.v"]" \
|
| 209 |
+
]
|
| 210 |
+
|
| 211 |
+
set constr_files [list \
|
| 212 |
+
"[file normalize "../nexys4_ddr.xdc"]" \
|
| 213 |
+
]
|
| 214 |
+
|
| 215 |
+
set sim_files [list \
|
| 216 |
+
"[file normalize "../../../testbench/sdr_sdram"]" \
|
| 217 |
+
"[file normalize "../../../testbench/sdr_sdram/sdr.v"]" \
|
| 218 |
+
"[file normalize "../../../testbench/sdr_sdram/sdr_parameters.vh"]" \
|
| 219 |
+
"[file normalize "../../../testbench/mfp_testbench.v"]" \
|
| 220 |
+
"[file normalize "../../../testbench/mfp_uart_testbench.v"]" \
|
| 221 |
+
]
|
| 222 |
+
|
| 223 |
+
# create project
|
| 224 |
+
create_project $project_name $project_path -part $project_part -force
|
| 225 |
+
|
| 226 |
+
# fill 'sources_1' fileset
|
| 227 |
+
if {[info exists source_files]} {
|
| 228 |
+
add_files -norecurse -fileset [get_filesets sources_1] $source_files
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
# fill 'constrs_1' fileset
|
| 232 |
+
if {[info exists constr_files]} {
|
| 233 |
+
add_files -norecurse -fileset [get_filesets constrs_1] $constr_files
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
# fill 'sim_1' fileset
|
| 237 |
+
if {[info exists sim_files]} {
|
| 238 |
+
set obj [get_filesets sim_1]
|
| 239 |
+
add_files -norecurse -fileset $obj $sim_files
|
| 240 |
+
set_property top $testbench_top $obj
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
# define macros VIVADO_SYNTHESIS
|
| 244 |
+
set_property -name {STEPS.SYNTH_DESIGN.ARGS.MORE OPTIONS} -value {-verilog_define VIVADO_SYNTHESIS} -objects [get_runs synth_1]
|
| 245 |
+
|
| 246 |
+
puts "INFO: Project created:$project_name"
|
MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/system_load.tcl
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
set project_name "system"
|
| 3 |
+
set hw_device "xc7a100t_0"
|
| 4 |
+
|
| 5 |
+
open_project "$project_name.xpr"; # open Vivado project
|
| 6 |
+
open_hw; # open the Hardware Manager
|
| 7 |
+
connect_hw_server; # open a connection to a hardware server
|
| 8 |
+
open_hw_target; # connect to the board
|
| 9 |
+
|
| 10 |
+
# set a file to be programmed
|
| 11 |
+
set_property PROGRAM.FILE "$project_name.bit" [get_hw_devices $hw_device];
|
| 12 |
+
|
| 13 |
+
# chip programming
|
| 14 |
+
program_hw_devices [get_hw_devices $hw_device]
|
| 15 |
+
#refresh_hw_device -update_hw_probes false [lindex [get_hw_devices $hw_device] 0]
|
| 16 |
+
|
| 17 |
+
# connections and project closing
|
| 18 |
+
close_hw_target
|
| 19 |
+
disconnect_hw_server
|
| 20 |
+
close_hw
|
| 21 |
+
close_project
|
MIPSfpga_mipsfpga-plus/boards/nexys4_ddr/system_synth.tcl
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
set project_name "system"
|
| 3 |
+
set synth_task "synth_1"
|
| 4 |
+
set impl_task "impl_1"
|
| 5 |
+
set timing_report "timing_1"
|
| 6 |
+
|
| 7 |
+
open_project "$project_name.xpr"
|
| 8 |
+
|
| 9 |
+
# run synthesis
|
| 10 |
+
launch_runs $synth_task
|
| 11 |
+
wait_on_run -verbose $synth_task
|
| 12 |
+
|
| 13 |
+
# run implementation
|
| 14 |
+
launch_runs $impl_task
|
| 15 |
+
wait_on_run -verbose $impl_task
|
| 16 |
+
|
| 17 |
+
# write bitstream
|
| 18 |
+
open_run $impl_task -name $impl_task
|
| 19 |
+
write_bitstream "$project_name.bit"
|
MIPSfpga_mipsfpga-plus/documentation/figure_generator/generator.cpp
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "utilities.cpp"
|
| 2 |
+
|
| 3 |
+
struct board_descriptor
|
| 4 |
+
{
|
| 5 |
+
char const * module_name;
|
| 6 |
+
int testbench;
|
| 7 |
+
int clock_frequency;
|
| 8 |
+
int altera;
|
| 9 |
+
int static_7_segment_display;
|
| 10 |
+
int dynamic_7_segment_display;
|
| 11 |
+
char const * description;
|
| 12 |
+
}
|
| 13 |
+
boards [] =
|
| 14 |
+
{
|
| 15 |
+
{ "mfp_testbench" , 1 , 0 , 0 , 0 , 0 , "Testbench for RTL simulation" },
|
| 16 |
+
{ "nexys4_ddr" , 0 , 100 , 0 , 0 , 1 , "Wrapper for Digilent Nexys 4 DDR board with Xilinx Artix-7 FPGA" },
|
| 17 |
+
{ "de0_cv" , 0 , 50 , 1 , 1 , 0 , "Wrapper for Terasic DE0-CV board with Altera Cyclone V FPGA" },
|
| 18 |
+
{ "nexys4_ddr" , 0 , 100 , 0 , 0 , 1 , "Wrapper for Digilent Nexys 4 DDR board with Xilinx Artix-7 FPGA (without 7-segment display module)" },
|
| 19 |
+
{ "de0_cv" , 0 , 50 , 1 , 1 , 0 , "Wrapper for Terasic DE0-CV board with Altera Cyclone V FPGA (without 7-segment display module)" },
|
| 20 |
+
{ "de0_nano" , 0 , 50 , 1 , 0 , 0 , "Wrapper for Terasic DE0-Nano board with Altera Cyclone IV FPGA" },
|
| 21 |
+
{ "basys3" , 0 , 100 , 0 , 0 , 1 , "Wrapper for Digilent Basys 3 board with Xilinx Artix-7 FPGA" },
|
| 22 |
+
{ "marsohod3" , 0 , 50 , 1 , 0 , 0 , "Wrapper for Marsohod 3 board with Altera MAX10 FPGA" }
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
int i_board;
|
| 26 |
+
int narrow_write_support;
|
| 27 |
+
int switchable_clock;
|
| 28 |
+
int light_sensor;
|
| 29 |
+
int serial_loader;
|
| 30 |
+
int without_7_segment_display;
|
| 31 |
+
|
| 32 |
+
void print_hierarchy ()
|
| 33 |
+
{
|
| 34 |
+
current_module_is_already_described = 0;
|
| 35 |
+
|
| 36 |
+
board_descriptor * b = & boards [i_board];
|
| 37 |
+
|
| 38 |
+
char buf [BUFSIZ];
|
| 39 |
+
|
| 40 |
+
sprintf
|
| 41 |
+
(
|
| 42 |
+
buf,
|
| 43 |
+
"../run/hierarchy_%s%s%s%s%s%s%s.html",
|
| 44 |
+
b -> module_name,
|
| 45 |
+
narrow_write_support ? "__narrow_write_support" : "",
|
| 46 |
+
light_sensor ? "__light_sensor" : "",
|
| 47 |
+
serial_loader ? "__serial_loader" : "",
|
| 48 |
+
switchable_clock ? "__switchable_clock" : "",
|
| 49 |
+
without_7_segment_display ? "__wo_7_segment_display" : "",
|
| 50 |
+
current_module_name != NULL ? "__" : "",
|
| 51 |
+
current_module_name != NULL ? current_module_name : ""
|
| 52 |
+
);
|
| 53 |
+
|
| 54 |
+
freopen (buf, "w", stdout);
|
| 55 |
+
|
| 56 |
+
char const * file_url = NULL;
|
| 57 |
+
|
| 58 |
+
if (! b -> testbench)
|
| 59 |
+
{
|
| 60 |
+
sprintf (buf, "boards/%s/%s.v",
|
| 61 |
+
b -> module_name,
|
| 62 |
+
b -> module_name);
|
| 63 |
+
|
| 64 |
+
file_url = buf;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
header
|
| 68 |
+
|
| 69 |
+
module
|
| 70 |
+
(
|
| 71 |
+
file_url,
|
| 72 |
+
b -> module_name,
|
| 73 |
+
NULL,
|
| 74 |
+
b -> description
|
| 75 |
+
);
|
| 76 |
+
|
| 77 |
+
if ( switchable_clock
|
| 78 |
+
||
|
| 79 |
+
! without_7_segment_display
|
| 80 |
+
&& (b -> static_7_segment_display || b -> dynamic_7_segment_display))
|
| 81 |
+
{
|
| 82 |
+
group
|
| 83 |
+
|
| 84 |
+
if (switchable_clock)
|
| 85 |
+
{
|
| 86 |
+
group
|
| 87 |
+
|
| 88 |
+
module ("mfp_switch_and_button_debouncers.v", "mfp_multi_switch_or_button_sync_and_debouncer");
|
| 89 |
+
leaf ("mfp_switch_and_button_debouncers.v", "mfp_switch_or_button_sync_and_debouncer", NULL,
|
| 90 |
+
"Debouncer for the switches that control the clock");
|
| 91 |
+
_module
|
| 92 |
+
|
| 93 |
+
vbreak
|
| 94 |
+
|
| 95 |
+
if (b -> clock_frequency == 50)
|
| 96 |
+
module ("mfp_clock_dividers.v", "mfp_clock_divider_50_MHz_to_25_MHz_12_Hz_0_75_Hz");
|
| 97 |
+
else if (b -> clock_frequency == 100)
|
| 98 |
+
module ("mfp_clock_dividers.v", "mfp_clock_divider_100_MHz_to_25_MHz_12_Hz_0_75_Hz");
|
| 99 |
+
|
| 100 |
+
leaf ("mfp_clock_dividers.v", "mfp_clock_divider");
|
| 101 |
+
|
| 102 |
+
_module
|
| 103 |
+
|
| 104 |
+
vbreak
|
| 105 |
+
|
| 106 |
+
if (b -> altera)
|
| 107 |
+
leaf (NULL, "global", "gclk", "Needed for the divided clock");
|
| 108 |
+
else
|
| 109 |
+
leaf (NULL, "BUFG", NULL, "Needed for the divided clock");
|
| 110 |
+
|
| 111 |
+
_group
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
if ( ! without_7_segment_display
|
| 115 |
+
&& (b -> static_7_segment_display || b -> dynamic_7_segment_display))
|
| 116 |
+
{
|
| 117 |
+
hbreak
|
| 118 |
+
|
| 119 |
+
if (b -> static_7_segment_display)
|
| 120 |
+
{
|
| 121 |
+
group
|
| 122 |
+
leaf ("mfp_seven_segment_displays.v", "mfp_single_digit_seven_segment_display", "digit_0");
|
| 123 |
+
vbreak
|
| 124 |
+
leaf ("mfp_seven_segment_displays.v", "mfp_single_digit_seven_segment_display", "digit_1");
|
| 125 |
+
vbreak
|
| 126 |
+
leaf ("mfp_seven_segment_displays.v", "mfp_single_digit_seven_segment_display", "digit_2");
|
| 127 |
+
vbreak
|
| 128 |
+
ellipsis
|
| 129 |
+
_group
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
if (b -> dynamic_7_segment_display)
|
| 133 |
+
{
|
| 134 |
+
group
|
| 135 |
+
leaf ("mfp_clock_dividers.v", "mfp_clock_divider_100_MHz_to_763_Hz", NULL, "Clock for 7-segment display");
|
| 136 |
+
vbreak
|
| 137 |
+
leaf ("mfp_seven_segment_displays.v", "mfp_multi_digit_display");
|
| 138 |
+
_group
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
_group
|
| 143 |
+
|
| 144 |
+
vbreak
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
module ("mfp_system.v", "mfp_system", NULL, NULL, 2 + light_sensor);
|
| 148 |
+
group
|
| 149 |
+
leaf (mipsfpga_download_instruction, "m14k_top", NULL, "The CPU core");
|
| 150 |
+
vbreak
|
| 151 |
+
leaf ("mfp_system.v", "mfp_ejtag_reset");
|
| 152 |
+
_group
|
| 153 |
+
|
| 154 |
+
hbreak
|
| 155 |
+
|
| 156 |
+
if (serial_loader)
|
| 157 |
+
{
|
| 158 |
+
module ("mfp_ahb_lite_matrix_with_loader.v", "mfp_ahb_lite_matrix_with_loader", NULL, NULL, 2);
|
| 159 |
+
group
|
| 160 |
+
leaf ("mfp_uart_receiver.v", "mfp_uart_receiver", NULL, "Receives data bytes from the PC via UART");
|
| 161 |
+
vbreak
|
| 162 |
+
leaf ("mfp_srec_parser.v", "mfp_srec_parser", NULL, "Parses data received via UART as text in Motorola S-Record format and issues transactions to fill the system memory with this data");
|
| 163 |
+
vbreak
|
| 164 |
+
leaf ("mfp_srec_parser_to_ahb_lite_bridge.v", "mfp_srec_parser_to_ahb_lite_bridge", NULL, "Converts the transactions from S-Record parser into AHB-Lite protocol. Also converts virtual addresses into physical using fixed mapping");
|
| 165 |
+
_group
|
| 166 |
+
|
| 167 |
+
hbreak
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
module ("mfp_ahb_lite_matrix.v", "mfp_ahb_lite_matrix" );
|
| 171 |
+
|
| 172 |
+
leaf ("mfp_ahb_lite_matrix.v", "mfp_ahb_lite_decoder" );
|
| 173 |
+
vbreak
|
| 174 |
+
|
| 175 |
+
module ("mfp_ahb_ram_slave.v", "mfp_ahb_ram_slave", "reset_ram");
|
| 176 |
+
|
| 177 |
+
if (narrow_write_support)
|
| 178 |
+
{
|
| 179 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram", "i0");
|
| 180 |
+
vbreak
|
| 181 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram", "i1");
|
| 182 |
+
vbreak
|
| 183 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram", "i2");
|
| 184 |
+
vbreak
|
| 185 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram", "i3");
|
| 186 |
+
}
|
| 187 |
+
else
|
| 188 |
+
{
|
| 189 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram");
|
| 190 |
+
}
|
| 191 |
+
_module
|
| 192 |
+
|
| 193 |
+
vbreak
|
| 194 |
+
|
| 195 |
+
module ("mfp_ahb_ram_slave.v", "mfp_ahb_ram_slave", "ram");
|
| 196 |
+
if (narrow_write_support)
|
| 197 |
+
{
|
| 198 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram", "i0");
|
| 199 |
+
vbreak
|
| 200 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram", "i1");
|
| 201 |
+
vbreak
|
| 202 |
+
ellipsis
|
| 203 |
+
}
|
| 204 |
+
else
|
| 205 |
+
{
|
| 206 |
+
leaf ("mfp_dual_port_ram.v", "mfp_dual_port_ram");
|
| 207 |
+
}
|
| 208 |
+
_module
|
| 209 |
+
|
| 210 |
+
vbreak
|
| 211 |
+
leaf ("mfp_ahb_gpio_slave.v", "mfp_ahb_gpio_slave", "gpio");
|
| 212 |
+
vbreak
|
| 213 |
+
leaf ("mfp_ahb_lite_matrix.v", "mfp_ahb_lite_response_mux");
|
| 214 |
+
|
| 215 |
+
_module
|
| 216 |
+
|
| 217 |
+
if (serial_loader)
|
| 218 |
+
_module
|
| 219 |
+
|
| 220 |
+
if (light_sensor)
|
| 221 |
+
{
|
| 222 |
+
hbreak
|
| 223 |
+
leaf ("mfp_pmod_als_spi_receiver.v", "mfp_pmod_als_spi_receiver", NULL, "Receives data from the light sensor using a version of SPI protocol");
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
_module
|
| 227 |
+
|
| 228 |
+
_module
|
| 229 |
+
footer
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
//----------------------------------------------------------------------------
|
| 233 |
+
|
| 234 |
+
int main ()
|
| 235 |
+
{
|
| 236 |
+
if (0)
|
| 237 |
+
{
|
| 238 |
+
for (i_board = 0; i_board < sizeof (boards) / sizeof (* boards); i_board ++)
|
| 239 |
+
for (narrow_write_support = 0; narrow_write_support <= 1; narrow_write_support ++)
|
| 240 |
+
for (switchable_clock = 0; switchable_clock <= 1; switchable_clock ++)
|
| 241 |
+
for (light_sensor = 0; light_sensor <= 1; light_sensor ++)
|
| 242 |
+
for (serial_loader = 0; serial_loader <= 1; serial_loader ++)
|
| 243 |
+
{
|
| 244 |
+
int features = narrow_write_support
|
| 245 |
+
+ switchable_clock + light_sensor + serial_loader;
|
| 246 |
+
|
| 247 |
+
if ( i_board == 0 && (switchable_clock + light_sensor + serial_loader) != 0
|
| 248 |
+
|| i_board != 0 && narrow_write_support == 0
|
| 249 |
+
|| i_board > 2 )
|
| 250 |
+
{
|
| 251 |
+
continue;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
// module_names and n_module_names are extracted when current_module_name is NULL
|
| 255 |
+
|
| 256 |
+
n_module_names = 0;
|
| 257 |
+
current_module_name = NULL;
|
| 258 |
+
|
| 259 |
+
print_hierarchy ();
|
| 260 |
+
|
| 261 |
+
for (int i = 0; i < n_module_names; i ++)
|
| 262 |
+
{
|
| 263 |
+
current_module_name = module_names [i];
|
| 264 |
+
|
| 265 |
+
if (current_module_name != NULL)
|
| 266 |
+
print_hierarchy ();
|
| 267 |
+
}
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
if (0)
|
| 272 |
+
{
|
| 273 |
+
// Special cases
|
| 274 |
+
|
| 275 |
+
current_module_name = NULL;
|
| 276 |
+
|
| 277 |
+
i_board = 0;
|
| 278 |
+
narrow_write_support = 0;
|
| 279 |
+
switchable_clock = 0;
|
| 280 |
+
light_sensor = 0;
|
| 281 |
+
serial_loader = 0;
|
| 282 |
+
|
| 283 |
+
print_hierarchy ();
|
| 284 |
+
|
| 285 |
+
narrow_write_support = 1;
|
| 286 |
+
|
| 287 |
+
print_hierarchy ();
|
| 288 |
+
|
| 289 |
+
light_sensor = 1;
|
| 290 |
+
serial_loader = 1;
|
| 291 |
+
|
| 292 |
+
print_hierarchy ();
|
| 293 |
+
|
| 294 |
+
for (i_board = 1; i_board <= 2; i_board ++)
|
| 295 |
+
{
|
| 296 |
+
narrow_write_support = 0;
|
| 297 |
+
switchable_clock = 0;
|
| 298 |
+
light_sensor = 0;
|
| 299 |
+
serial_loader = 0;
|
| 300 |
+
|
| 301 |
+
print_hierarchy ();
|
| 302 |
+
|
| 303 |
+
narrow_write_support = 1;
|
| 304 |
+
print_hierarchy ();
|
| 305 |
+
|
| 306 |
+
light_sensor = 1;
|
| 307 |
+
print_hierarchy ();
|
| 308 |
+
|
| 309 |
+
serial_loader = 1;
|
| 310 |
+
print_hierarchy ();
|
| 311 |
+
|
| 312 |
+
switchable_clock = 1;
|
| 313 |
+
print_hierarchy ();
|
| 314 |
+
}
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
// Support for Lab YP1. Serial Loader Flow
|
| 318 |
+
|
| 319 |
+
current_module_name = NULL;
|
| 320 |
+
|
| 321 |
+
for (i_board = 3; i_board <= 4; i_board ++)
|
| 322 |
+
{
|
| 323 |
+
narrow_write_support = 1;
|
| 324 |
+
switchable_clock = 0;
|
| 325 |
+
light_sensor = 0;
|
| 326 |
+
without_7_segment_display = 1;
|
| 327 |
+
|
| 328 |
+
serial_loader = 0;
|
| 329 |
+
print_hierarchy ();
|
| 330 |
+
|
| 331 |
+
serial_loader = 1;
|
| 332 |
+
print_hierarchy ();
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
return 0;
|
| 336 |
+
}
|
MIPSfpga_mipsfpga-plus/documentation/figure_generator/utilities.cpp
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# include "stdio.h"
|
| 2 |
+
# include "string.h"
|
| 3 |
+
|
| 4 |
+
char const mipsfpga_plus_github_location [] = "http://github.com/MIPSfpga/mipsfpga-plus/blob/master";
|
| 5 |
+
char const mipsfpga_download_instruction [] = "http://www.silicon-russia.com/2015/12/11/mipsfpga-download-instructions";
|
| 6 |
+
|
| 7 |
+
const char * module_names [1000];
|
| 8 |
+
int n_module_names;
|
| 9 |
+
|
| 10 |
+
const char * current_module_name;
|
| 11 |
+
int current_module_is_already_described;
|
| 12 |
+
|
| 13 |
+
int level = 0;
|
| 14 |
+
|
| 15 |
+
//----------------------------------------------------------------------------
|
| 16 |
+
|
| 17 |
+
#define p printf
|
| 18 |
+
|
| 19 |
+
#define header p ("<font size=2 face=\"Verdana, Arial, Helvetica, sans_serif\">\n");
|
| 20 |
+
#define footer p ("</font>\n");
|
| 21 |
+
|
| 22 |
+
#define tr p ("<tr>\n");
|
| 23 |
+
#define td p ("<td valign=top>\n");
|
| 24 |
+
#define _tr p ("</tr>\n");
|
| 25 |
+
#define _td p ("</td>\n");
|
| 26 |
+
#define hbreak _td td
|
| 27 |
+
#define vbreak _td _tr tr td
|
| 28 |
+
#define ellipsis p (". . . . . . . . . .<br><br>\n");
|
| 29 |
+
|
| 30 |
+
//----------------------------------------------------------------------------
|
| 31 |
+
|
| 32 |
+
void module
|
| 33 |
+
(
|
| 34 |
+
const char * file_url = NULL,
|
| 35 |
+
const char * module_name = NULL,
|
| 36 |
+
const char * instance_name = NULL,
|
| 37 |
+
const char * description = NULL,
|
| 38 |
+
int colspan = 1
|
| 39 |
+
)
|
| 40 |
+
{
|
| 41 |
+
level ++;
|
| 42 |
+
|
| 43 |
+
if (current_module_name == NULL && module_name != NULL)
|
| 44 |
+
module_names [n_module_names ++] = module_name;
|
| 45 |
+
|
| 46 |
+
int the_module_is_current
|
| 47 |
+
|
| 48 |
+
= current_module_name != NULL
|
| 49 |
+
&& module_name != NULL
|
| 50 |
+
&& strcmp (module_name, current_module_name) == 0;
|
| 51 |
+
|
| 52 |
+
// if (! the_module_is_current || current_module_is_already_described)
|
| 53 |
+
// description = NULL;
|
| 54 |
+
|
| 55 |
+
if (the_module_is_current)
|
| 56 |
+
current_module_is_already_described = 1;
|
| 57 |
+
|
| 58 |
+
char buf [BUFSIZ];
|
| 59 |
+
|
| 60 |
+
if (file_url != NULL && strstr (file_url, "http") == NULL)
|
| 61 |
+
{
|
| 62 |
+
sprintf (buf, "%s/%s", mipsfpga_plus_github_location, file_url);
|
| 63 |
+
file_url = buf;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
p ("<table width=%s", level == 1 ? "1000" : "100%%");
|
| 67 |
+
|
| 68 |
+
char const * level_colors []
|
| 69 |
+
= { "A3FFD1", "A3FFFF", "A3D1FF" };
|
| 70 |
+
|
| 71 |
+
p (" bgcolor=#%s", the_module_is_current ? "FFFF29"
|
| 72 |
+
: level_colors [level % (sizeof (level_colors) / sizeof (* level_colors))]);
|
| 73 |
+
|
| 74 |
+
if (module_name != NULL || instance_name != NULL || description != NULL) p (" border=2");
|
| 75 |
+
|
| 76 |
+
p (" cellpadding=10 cellspacing=0 rules=none>\n");
|
| 77 |
+
|
| 78 |
+
if (module_name != NULL || instance_name != NULL || description != NULL)
|
| 79 |
+
{
|
| 80 |
+
// p ("<tr><td valign=top nowrap=nowrap");
|
| 81 |
+
p ("<tr><td valign=top");
|
| 82 |
+
|
| 83 |
+
if (colspan != 1)
|
| 84 |
+
p (" colspan=%d", colspan);
|
| 85 |
+
|
| 86 |
+
p (">\n");
|
| 87 |
+
|
| 88 |
+
if (module_name != NULL || instance_name != NULL) p ("<b>");
|
| 89 |
+
|
| 90 |
+
if (module_name != NULL)
|
| 91 |
+
{
|
| 92 |
+
if (file_url != NULL) p ("<a href=\"%s\">", file_url);
|
| 93 |
+
|
| 94 |
+
p ("%s", module_name);
|
| 95 |
+
|
| 96 |
+
if (file_url != NULL) p ("</a>");
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
if (module_name != NULL && instance_name != NULL) p (" ");
|
| 100 |
+
|
| 101 |
+
if (instance_name != NULL) p ("%s", instance_name);
|
| 102 |
+
|
| 103 |
+
if (module_name != NULL || instance_name != NULL) p ("</b>");
|
| 104 |
+
|
| 105 |
+
if ((module_name != NULL || instance_name != NULL) && description != NULL) p ("<br><br>\n");
|
| 106 |
+
|
| 107 |
+
if (description != NULL) p ("%s", description);
|
| 108 |
+
|
| 109 |
+
p ("\n</td></tr>\n");
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
p ("<tr><td valign=top>\n");
|
| 113 |
+
|
| 114 |
+
colspan = 1;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
//----------------------------------------------------------------------------
|
| 118 |
+
|
| 119 |
+
#define _module p ("</td></tr>\n</table>\n"), level --;
|
| 120 |
+
|
| 121 |
+
#define group module ();
|
| 122 |
+
#define _group _module
|
| 123 |
+
|
| 124 |
+
//----------------------------------------------------------------------------
|
| 125 |
+
|
| 126 |
+
void leaf
|
| 127 |
+
(
|
| 128 |
+
const char * file_url = NULL,
|
| 129 |
+
const char * module_name = NULL,
|
| 130 |
+
const char * instance_name = NULL,
|
| 131 |
+
const char * description = NULL
|
| 132 |
+
)
|
| 133 |
+
{
|
| 134 |
+
module
|
| 135 |
+
(
|
| 136 |
+
file_url,
|
| 137 |
+
module_name,
|
| 138 |
+
instance_name,
|
| 139 |
+
description
|
| 140 |
+
);
|
| 141 |
+
|
| 142 |
+
_module
|
| 143 |
+
}
|
MIPSfpga_mipsfpga-plus/documentation/html_labs_for_blog/convert_html_to_wordpress.c
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include <stdio.h>
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
|
| 5 |
+
<pre>
|
| 6 |
+
<font face="Courier"><pre>
|
| 7 |
+
|
| 8 |
+
</pre>
|
| 9 |
+
</pre></font>
|
| 10 |
+
|
| 11 |
+
<p><big><big><b>
|
| 12 |
+
<h2>
|
| 13 |
+
|
| 14 |
+
<p><big><b>
|
| 15 |
+
<h3>
|
| 16 |
+
|
| 17 |
+
<p><b>
|
| 18 |
+
<h4>
|
| 19 |
+
|
| 20 |
+
</b></big></big></p>
|
| 21 |
+
</h2>
|
| 22 |
+
|
| 23 |
+
</b></big></p>
|
| 24 |
+
</h3>
|
| 25 |
+
|
| 26 |
+
</b></p>
|
| 27 |
+
</h4>
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
final_rename \<pre\> \<font face=\"Courier\"\>\<pre\>
|
| 33 |
+
|
| 34 |
+
final_rename \<\/pre\> \<\/pre\>\<font face=\"Courier\"\>
|
| 35 |
+
|
| 36 |
+
final_rename \<p\>\<big\>\<big\>\<b\> \<h2\>
|
| 37 |
+
|
| 38 |
+
final_rename \<p\>\<big\>\<b\> \<h3\>
|
| 39 |
+
|
| 40 |
+
final_rename \<p\>\<b\> \<h4\>
|
| 41 |
+
|
| 42 |
+
final_rename \<\/b\>\<\/big\>\<\/big\>\<\/p\> \<\/h2\>
|
| 43 |
+
|
| 44 |
+
final_rename \<\/b\>\<\/big\>\<\/p\> \<\/h3\>
|
| 45 |
+
|
| 46 |
+
final_rename \<\/b\>\<\/p\> \<\/h4\>
|
| 47 |
+
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
int main ()
|
| 51 |
+
{
|
| 52 |
+
int c, pc = 0, ppc = 0, pppc = 0, ppppc = 0, mode = 0;
|
| 53 |
+
|
| 54 |
+
while ((c = getchar ()) != EOF)
|
| 55 |
+
{
|
| 56 |
+
if ( ppc == '<' && pc == 'p' && c == '>')
|
| 57 |
+
mode = 1;
|
| 58 |
+
else if (pppc == '<' && ppc == '/' && pc == 'p' && c == '>')
|
| 59 |
+
mode = 0;
|
| 60 |
+
|
| 61 |
+
if ( pppc == '<' && ppc == 'l' && pc == 'i' && c == '>')
|
| 62 |
+
mode = 1;
|
| 63 |
+
else if (ppppc == '<' && pppc == '/' && ppc == 'l' && pc == 'i' && c == '>')
|
| 64 |
+
mode = 0;
|
| 65 |
+
|
| 66 |
+
if (mode && c == '\n')
|
| 67 |
+
c = ' ';
|
| 68 |
+
else if (c == '\r')
|
| 69 |
+
continue;
|
| 70 |
+
|
| 71 |
+
putchar (c);
|
| 72 |
+
|
| 73 |
+
ppppc = pppc;
|
| 74 |
+
pppc = ppc;
|
| 75 |
+
ppc = pc;
|
| 76 |
+
pc = c;
|
| 77 |
+
}
|
| 78 |
+
}
|
MIPSfpga_mipsfpga-plus/exercises/module_to_use/hc_sr04_ultrasonic_distance_sensor.v
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Note active positive reset
|
| 2 |
+
|
| 3 |
+
module hc_sr04_ultrasonic_distance_sensor
|
| 4 |
+
# (
|
| 5 |
+
parameter clk_frequency = 50000000,
|
| 6 |
+
relative_distance_width = 8
|
| 7 |
+
)
|
| 8 |
+
(
|
| 9 |
+
input clk,
|
| 10 |
+
input reset,
|
| 11 |
+
output reg trig,
|
| 12 |
+
input echo,
|
| 13 |
+
|
| 14 |
+
output reg [relative_distance_width - 1:0] relative_distance
|
| 15 |
+
);
|
| 16 |
+
|
| 17 |
+
// Datasheet: http://www.micropik.com/PDF/HCSR04.pdf
|
| 18 |
+
// Time is measured in clk cycles unless noted otherwise
|
| 19 |
+
|
| 20 |
+
localparam
|
| 21 |
+
|
| 22 |
+
speed_of_sound_meters_per_second = 343,
|
| 23 |
+
max_range_in_centimeters = 400, // From datasheet
|
| 24 |
+
|
| 25 |
+
measurement_cycle_in_milliseconds = 200, // From datasheet min is 60
|
| 26 |
+
trig_time_in_microseconds = 10, // From datasheet
|
| 27 |
+
|
| 28 |
+
measurement_cycle_time
|
| 29 |
+
= measurement_cycle_in_milliseconds * (clk_frequency / 1000),
|
| 30 |
+
|
| 31 |
+
trig_time
|
| 32 |
+
= trig_time_in_microseconds * (clk_frequency / 1000000),
|
| 33 |
+
|
| 34 |
+
echo_clk_cycles_per_centimeters
|
| 35 |
+
|
| 36 |
+
= clk_frequency
|
| 37 |
+
* 2 // Sound wave goes 2 ways
|
| 38 |
+
/ speed_of_sound_meters_per_second
|
| 39 |
+
/ 100, // Number of centimeters in meter
|
| 40 |
+
|
| 41 |
+
max_echo_time
|
| 42 |
+
= max_range_in_centimeters * echo_clk_cycles_per_centimeters,
|
| 43 |
+
|
| 44 |
+
// To accomodate values up to measurement_cycle_time - 1
|
| 45 |
+
trig_cnt_width = $clog2 (measurement_cycle_time),
|
| 46 |
+
|
| 47 |
+
// To accomodate values up to max_echo_time
|
| 48 |
+
echo_cnt_width = $clog2 (max_echo_time + 1);
|
| 49 |
+
|
| 50 |
+
`ifndef SIMULATION_ONLY
|
| 51 |
+
|
| 52 |
+
initial
|
| 53 |
+
begin
|
| 54 |
+
$display ( "speed_of_sound_meters_per_second : %0d", speed_of_sound_meters_per_second );
|
| 55 |
+
$display ( "max_range_in_centimeters : %0d", max_range_in_centimeters );
|
| 56 |
+
$display ( "measurement_cycle_in_milliseconds : %0d", measurement_cycle_in_milliseconds );
|
| 57 |
+
$display ( "trig_time_in_microseconds : %0d", trig_time_in_microseconds );
|
| 58 |
+
$display ( "measurement_cycle_time : %0d", measurement_cycle_time );
|
| 59 |
+
$display ( "trig_time : %0d", trig_time );
|
| 60 |
+
$display ( "echo_clk_cycles_per_centimeters : %0d", echo_clk_cycles_per_centimeters );
|
| 61 |
+
$display ( "max_echo_time : %0d", max_echo_time );
|
| 62 |
+
$display ( "trig_cnt_width : %0d", trig_cnt_width );
|
| 63 |
+
$display ( "echo_cnt_width : %0d", echo_cnt_width );
|
| 64 |
+
end
|
| 65 |
+
|
| 66 |
+
`endif
|
| 67 |
+
|
| 68 |
+
reg [trig_cnt_width - 1:0] trig_cnt;
|
| 69 |
+
|
| 70 |
+
always @ (posedge clk or posedge reset)
|
| 71 |
+
if (reset)
|
| 72 |
+
trig_cnt <= 0;
|
| 73 |
+
else if (trig_cnt == measurement_cycle_time - 1)
|
| 74 |
+
trig_cnt <= 0;
|
| 75 |
+
else
|
| 76 |
+
trig_cnt <= trig_cnt + 1;
|
| 77 |
+
|
| 78 |
+
// We have to wait after reset and after each measurement
|
| 79 |
+
|
| 80 |
+
always @ (posedge clk or posedge reset)
|
| 81 |
+
if (reset)
|
| 82 |
+
trig <= 0;
|
| 83 |
+
else if (trig_cnt == measurement_cycle_time - trig_time - 1)
|
| 84 |
+
trig <= 1;
|
| 85 |
+
else if (trig_cnt == measurement_cycle_time - 1)
|
| 86 |
+
trig <= 0;
|
| 87 |
+
|
| 88 |
+
reg prev_echo;
|
| 89 |
+
|
| 90 |
+
always @ (posedge clk or posedge reset)
|
| 91 |
+
if (reset)
|
| 92 |
+
prev_echo <= 0;
|
| 93 |
+
else
|
| 94 |
+
prev_echo <= echo;
|
| 95 |
+
|
| 96 |
+
wire posedge_echo = ~ prev_echo & echo;
|
| 97 |
+
wire negedge_echo = prev_echo & ~ echo;
|
| 98 |
+
|
| 99 |
+
reg [echo_cnt_width - 1:0] echo_cnt;
|
| 100 |
+
|
| 101 |
+
always @ (posedge clk or posedge reset)
|
| 102 |
+
if (reset)
|
| 103 |
+
begin
|
| 104 |
+
echo_cnt <= 0;
|
| 105 |
+
relative_distance <= 0;
|
| 106 |
+
end
|
| 107 |
+
else if (posedge_echo)
|
| 108 |
+
begin
|
| 109 |
+
echo_cnt <= 0;
|
| 110 |
+
end
|
| 111 |
+
else if (negedge_echo)
|
| 112 |
+
begin
|
| 113 |
+
relative_distance
|
| 114 |
+
<= echo_cnt [ echo_cnt_width - 1
|
| 115 |
+
: echo_cnt_width - relative_distance_width ];
|
| 116 |
+
end
|
| 117 |
+
else
|
| 118 |
+
begin
|
| 119 |
+
echo_cnt <= echo_cnt + 1;
|
| 120 |
+
end
|
| 121 |
+
|
| 122 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/exercises/module_to_use/m14k_udi_mipsfpga_ai.v
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//
|
| 2 |
+
// mips_start_of_legal_notice
|
| 3 |
+
// **********************************************************************
|
| 4 |
+
//
|
| 5 |
+
// Copyright (c) 2019 MIPS Tech, LLC, 300 Orchard City Dr., Suite 170,
|
| 6 |
+
// Campbell, CA 95008 USA. All rights reserved.
|
| 7 |
+
// This document contains information and code that is proprietary to
|
| 8 |
+
// MIPS Tech, LLC and MIPS' affiliates, as applicable, ("MIPS"). If this
|
| 9 |
+
// document is obtained pursuant to a MIPS Open license, the sole
|
| 10 |
+
// licensor under such license is MIPS Tech, LLC. This document and any
|
| 11 |
+
// information or code therein are protected by patent, copyright,
|
| 12 |
+
// trademarks and unfair competition laws, among others, and are
|
| 13 |
+
// distributed under a license restricting their use. MIPS has
|
| 14 |
+
// intellectual property rights, including patents or pending patent
|
| 15 |
+
// applications in the U.S. and in other countries, relating to the
|
| 16 |
+
// technology embodied in the product that is described in this document.
|
| 17 |
+
// Any distribution release of this document may include or be
|
| 18 |
+
// accompanied by materials developed by third parties. Any copying,
|
| 19 |
+
// reproducing, modifying or use of this information (in whole or in part)
|
| 20 |
+
// that is not expressly permitted in writing by MIPS or an authorized
|
| 21 |
+
// third party is strictly prohibited. Any document provided in source
|
| 22 |
+
// format (i.e., in a modifiable form such as in FrameMaker or
|
| 23 |
+
// Microsoft Word format) may be subject to separate use and distribution
|
| 24 |
+
// restrictions applicable to such document. UNDER NO CIRCUMSTANCES MAY A
|
| 25 |
+
// DOCUMENT PROVIDED IN SOURCE FORMAT BE DISTRIBUTED TO A THIRD PARTY IN
|
| 26 |
+
// SOURCE FORMAT WITHOUT THE EXPRESS WRITTEN PERMISSION OF, OR LICENSED
|
| 27 |
+
// FROM, MIPS. MIPS reserves the right to change the information or code
|
| 28 |
+
// contained in this document to improve function, design or otherwise.
|
| 29 |
+
// MIPS does not assume any liability arising out of the application or
|
| 30 |
+
// use of this information, or of any error or omission in such
|
| 31 |
+
// information. DOCUMENTATION AND CODE ARE PROVIDED "AS IS" AND ANY
|
| 32 |
+
// WARRANTIES, WHETHER EXPRESS, STATUTORY, IMPLIED OR OTHERWISE,
|
| 33 |
+
// INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 34 |
+
// FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE EXCLUDED,
|
| 35 |
+
// EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
|
| 36 |
+
// INVALID IN A COMPETENT JURISDICTION. Except as expressly provided in
|
| 37 |
+
// any written license agreement from MIPS or an authorized third party,
|
| 38 |
+
// the furnishing or distribution of this document does not give recipient
|
| 39 |
+
// any license to any intellectual property rights, including any patent
|
| 40 |
+
// rights, that cover the information in this document.
|
| 41 |
+
// Products covered by, and information or code, contained this document
|
| 42 |
+
// are controlled by U.S. export control laws and may be subject to the
|
| 43 |
+
// expert or import laws in other countries. The information contained
|
| 44 |
+
// in this document shall not be exported, reexported, transferred, or
|
| 45 |
+
// released, directly or indirectly, in violation of the law of any
|
| 46 |
+
// country or international law, regulation, treaty, executive order,
|
| 47 |
+
// statute, amendments or supplements thereto. Nuclear, missile, chemical
|
| 48 |
+
// weapons, biological weapons or nuclear maritime end uses, whether
|
| 49 |
+
// direct or indirect, are strictly prohibited. Should a conflict arise
|
| 50 |
+
// regarding the export, reexport, transfer, or release of the information
|
| 51 |
+
// contained in this document, the laws of the United States of America
|
| 52 |
+
// shall be the governing law.
|
| 53 |
+
// U.S Government Rights - Commercial software. Government users are
|
| 54 |
+
// subject to the MIPS Tech, LLC standard license agreement and applicable
|
| 55 |
+
// provisions of the FAR and its supplements.
|
| 56 |
+
// MIPS and MIPS Open are trademarks or registered trademarks of MIPS in
|
| 57 |
+
// the United States and other countries. All other trademarks referred
|
| 58 |
+
// to herein are the property of their respective owners.
|
| 59 |
+
//
|
| 60 |
+
//
|
| 61 |
+
// **********************************************************************
|
| 62 |
+
// mips_end_of_legal_notice
|
| 63 |
+
//
|
| 64 |
+
|
| 65 |
+
`include "m14k_const.vh"
|
| 66 |
+
|
| 67 |
+
module m14k_udi_mipsfpga_ai
|
| 68 |
+
(
|
| 69 |
+
input UDI_gclk, // Clock
|
| 70 |
+
input UDI_greset, // Reset
|
| 71 |
+
input UDI_gscanenable, // Scan enable
|
| 72 |
+
|
| 73 |
+
// Static signals
|
| 74 |
+
|
| 75 |
+
input UDI_endianb_e, // Endian : 0 = little , 1 = big
|
| 76 |
+
input UDI_kd_mode_e, // Mode : 0 = user , 1 = kernel or debug
|
| 77 |
+
output UDI_present, // UDI module is present
|
| 78 |
+
|
| 79 |
+
// E-stage signals (in the order of their timing)
|
| 80 |
+
|
| 81 |
+
input [31:0] UDI_ir_e, // Instruction register
|
| 82 |
+
input UDI_irvalid_e, // Instruction register valid
|
| 83 |
+
|
| 84 |
+
output UDI_ri_e, // The instruction is illegal
|
| 85 |
+
|
| 86 |
+
input [31:0] UDI_rs_e, // Value of register RS from register file
|
| 87 |
+
input [31:0] UDI_rt_e, // Value of register RT from register file
|
| 88 |
+
|
| 89 |
+
output [ 4:0] UDI_wrreg_e, // Register file index to write the result
|
| 90 |
+
// Zero index indicates don't write
|
| 91 |
+
|
| 92 |
+
input UDI_start_e, // Values of RS and RT valid
|
| 93 |
+
|
| 94 |
+
// M-stage signals (in the order of their timing)
|
| 95 |
+
|
| 96 |
+
output UDI_stall_m, // Stall the pipeline
|
| 97 |
+
output [31:0] UDI_rd_m, // Result to write back
|
| 98 |
+
|
| 99 |
+
input UDI_run_m, // Qualify UDI_kill_m
|
| 100 |
+
input UDI_kill_m, // Kill the instruction
|
| 101 |
+
|
| 102 |
+
// Other signals
|
| 103 |
+
|
| 104 |
+
output UDI_honor_cee, // UDI module has local state
|
| 105 |
+
|
| 106 |
+
input [`M14K_UDI_EXT_TOUDI_WIDTH - 1:0] UDI_toudi, // External input to UDI module
|
| 107 |
+
output [`M14K_UDI_EXT_FROMUDI_WIDTH - 1:0] UDI_fromudi // Output from UDI module to external system
|
| 108 |
+
);
|
| 109 |
+
|
| 110 |
+
assign UDI_present = 1'b1;
|
| 111 |
+
assign UDI_wrreg_e = UDI_ir_e [25:21]; // RS register
|
| 112 |
+
assign UDI_stall_m = 1'b0;
|
| 113 |
+
assign UDI_honor_cee = 1'b0;
|
| 114 |
+
assign UDI_fromudi = { `M14K_UDI_EXT_FROMUDI_WIDTH { 1'b0 } };
|
| 115 |
+
|
| 116 |
+
wire spc2 = ( UDI_ir_e [31:26] == 6'b011100 );
|
| 117 |
+
wire udi = ( UDI_ir_e [ 5: 4] == 2'b01 );
|
| 118 |
+
wire usr_udi_vld = ( UDI_ir_e [ 3: 1] == 3'b000 );
|
| 119 |
+
|
| 120 |
+
wire ir_ok = spc2 & udi & usr_udi_vld & UDI_irvalid_e;
|
| 121 |
+
assign UDI_ri_e = ! ir_ok;
|
| 122 |
+
|
| 123 |
+
wire run_instr = ir_ok & UDI_start_e;
|
| 124 |
+
|
| 125 |
+
wire [15:0] imm16 = { UDI_ir_e [0], UDI_ir_e [20:6] };
|
| 126 |
+
|
| 127 |
+
wire [31:0] e_res, e_res_q;
|
| 128 |
+
|
| 129 |
+
assign e_res [ 7: 0] = UDI_rs_e [ 7: 0] * imm16 [ 3: 0];
|
| 130 |
+
assign e_res [15: 8] = UDI_rs_e [15: 8] * imm16 [ 7: 4];
|
| 131 |
+
assign e_res [23:16] = UDI_rs_e [23:16] * imm16 [11: 8];
|
| 132 |
+
assign e_res [31:24] = UDI_rs_e [31:24] * imm16 [15:12];
|
| 133 |
+
|
| 134 |
+
mvp_cregister_wide # (32) e_res_r
|
| 135 |
+
(
|
| 136 |
+
.q ( e_res_q ),
|
| 137 |
+
.scanenable ( UDI_gscanenable ),
|
| 138 |
+
.cond ( run_instr ),
|
| 139 |
+
.clk ( UDI_gclk ),
|
| 140 |
+
.d ( e_res )
|
| 141 |
+
);
|
| 142 |
+
|
| 143 |
+
wire [7:0] m_res_01 = e_res_q [15: 8] + e_res_q [ 7:0];
|
| 144 |
+
wire [7:0] m_res_23 = e_res_q [31:24] + e_res_q [23:16];
|
| 145 |
+
wire [7:0] m_res = m_res_01 + m_res_23;
|
| 146 |
+
|
| 147 |
+
assign UDI_rd_m = { 24'b0, m_res };
|
| 148 |
+
|
| 149 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/exercises/module_to_use/pmod_als_light_sensor.v
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Note active positive reset
|
| 2 |
+
|
| 3 |
+
module pmod_als_light_sensor
|
| 4 |
+
(
|
| 5 |
+
input clk,
|
| 6 |
+
input reset,
|
| 7 |
+
output cs,
|
| 8 |
+
output sck,
|
| 9 |
+
input sdo,
|
| 10 |
+
output reg [15:0] value
|
| 11 |
+
);
|
| 12 |
+
|
| 13 |
+
reg [ 8:0] cnt;
|
| 14 |
+
reg [15:0] shift;
|
| 15 |
+
|
| 16 |
+
always @ (posedge clk or posedge reset)
|
| 17 |
+
begin
|
| 18 |
+
if (reset)
|
| 19 |
+
cnt <= 8'b100;
|
| 20 |
+
else
|
| 21 |
+
cnt <= cnt + 8'b1;
|
| 22 |
+
end
|
| 23 |
+
|
| 24 |
+
assign sck = ~ cnt [3];
|
| 25 |
+
assign cs = cnt [8];
|
| 26 |
+
|
| 27 |
+
wire sample_bit = ( cs == 1'b0 && cnt [3:0] == 4'b1111 );
|
| 28 |
+
wire value_done = ( cs == 1'b1 && cnt [7:0] == 8'b0 );
|
| 29 |
+
|
| 30 |
+
always @ (posedge clk or posedge reset)
|
| 31 |
+
begin
|
| 32 |
+
if (reset)
|
| 33 |
+
begin
|
| 34 |
+
shift <= 16'h0000;
|
| 35 |
+
value <= 16'h0000;
|
| 36 |
+
end
|
| 37 |
+
else if (sample_bit)
|
| 38 |
+
begin
|
| 39 |
+
shift <= (shift << 1) | sdo;
|
| 40 |
+
end
|
| 41 |
+
else if (value_done)
|
| 42 |
+
begin
|
| 43 |
+
value <= shift;
|
| 44 |
+
end
|
| 45 |
+
end
|
| 46 |
+
|
| 47 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/exercises/module_to_use/pmod_enc_rotary_encoder.v
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Note active positive reset
|
| 2 |
+
|
| 3 |
+
module pmod_enc_rotary_encoder
|
| 4 |
+
(
|
| 5 |
+
input clk,
|
| 6 |
+
input reset,
|
| 7 |
+
input a,
|
| 8 |
+
input b,
|
| 9 |
+
output reg [15:0] value
|
| 10 |
+
);
|
| 11 |
+
|
| 12 |
+
reg prev_a;
|
| 13 |
+
|
| 14 |
+
always @ (posedge clk or posedge reset)
|
| 15 |
+
if (reset)
|
| 16 |
+
prev_a <= 1'b1;
|
| 17 |
+
else
|
| 18 |
+
prev_a <= a;
|
| 19 |
+
|
| 20 |
+
always @ (posedge clk or posedge reset)
|
| 21 |
+
if (reset)
|
| 22 |
+
begin
|
| 23 |
+
value <= - 16'd1; // To do: figure out why we have to start with -1 and not 0
|
| 24 |
+
end
|
| 25 |
+
else if (a && ! prev_a)
|
| 26 |
+
begin
|
| 27 |
+
if (b)
|
| 28 |
+
value <= value + 16'd1;
|
| 29 |
+
else
|
| 30 |
+
value <= value - 16'd1;
|
| 31 |
+
end
|
| 32 |
+
|
| 33 |
+
endmodule
|
MIPSfpga_mipsfpga-plus/programs/00_counter/main.c
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "mfp_memory_mapped_registers.h"
|
| 2 |
+
|
| 3 |
+
int main ()
|
| 4 |
+
{
|
| 5 |
+
long long int n = 0;
|
| 6 |
+
|
| 7 |
+
for (;;)
|
| 8 |
+
{
|
| 9 |
+
/*
|
| 10 |
+
MFP_RED_LEDS = n;
|
| 11 |
+
MFP_GREEN_LEDS = n;
|
| 12 |
+
MFP_7_SEGMENT_HEX = n;
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
MFP_RED_LEDS = n >> 16;
|
| 16 |
+
MFP_GREEN_LEDS = n >> 16;
|
| 17 |
+
MFP_7_SEGMENT_HEX = ((n >> 8) & 0xffffff00) | (n & 0xff);
|
| 18 |
+
|
| 19 |
+
n ++;
|
| 20 |
+
|
| 21 |
+
// asm ("mfc0 $8, $15, 0");
|
| 22 |
+
// MFP_7_SEGMENT_HEX = 1;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
return 0;
|
| 26 |
+
}
|
MIPSfpga_mipsfpga-plus/programs/00_counter/mfp_memory_mapped_registers.h
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef MFP_MEMORY_MAPPED_REGISTERS_H
|
| 2 |
+
#define MFP_MEMORY_MAPPED_REGISTERS_H
|
| 3 |
+
|
| 4 |
+
#define MFP_RED_LEDS_ADDR 0xBF800000
|
| 5 |
+
#define MFP_GREEN_LEDS_ADDR 0xBF800004
|
| 6 |
+
#define MFP_SWITCHES_ADDR 0xBF800008
|
| 7 |
+
#define MFP_BUTTONS_ADDR 0xBF80000C
|
| 8 |
+
#define MFP_7_SEGMENT_HEX_ADDR 0xBF800010
|
| 9 |
+
|
| 10 |
+
#define MFP_RED_LEDS (* (volatile unsigned *) MFP_RED_LEDS_ADDR )
|
| 11 |
+
#define MFP_GREEN_LEDS (* (volatile unsigned *) MFP_GREEN_LEDS_ADDR )
|
| 12 |
+
#define MFP_SWITCHES (* (volatile unsigned *) MFP_SWITCHES_ADDR )
|
| 13 |
+
#define MFP_BUTTONS (* (volatile unsigned *) MFP_BUTTONS_ADDR )
|
| 14 |
+
#define MFP_7_SEGMENT_HEX (* (volatile unsigned *) MFP_7_SEGMENT_HEX_ADDR )
|
| 15 |
+
|
| 16 |
+
// This define is used in boot.S code
|
| 17 |
+
|
| 18 |
+
#define BOARD_16_LEDS_ADDR MFP_RED_LEDS_ADDR
|
| 19 |
+
|
| 20 |
+
#endif
|
MIPSfpga_mipsfpga-plus/programs/00_counter/modelsim_script.tcl
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
vlib work
|
| 3 |
+
|
| 4 |
+
set p0 -vlog01compat
|
| 5 |
+
set p1 +define+SIMULATION
|
| 6 |
+
|
| 7 |
+
set i0 +incdir+../../../core
|
| 8 |
+
set i1 +incdir+../../../system_rtl
|
| 9 |
+
set i2 +incdir+../../../system_rtl/uart16550
|
| 10 |
+
set i3 +incdir+../../../testbench
|
| 11 |
+
set i4 +incdir+../../../testbench/sdr_sdram
|
| 12 |
+
|
| 13 |
+
set s0 ../../../core/*.v
|
| 14 |
+
set s1 ../../../system_rtl/*.v
|
| 15 |
+
set s2 ../../../system_rtl/uart16550/*.v
|
| 16 |
+
set s3 ../../../testbench/*.v
|
| 17 |
+
set s4 ../../../testbench/sdr_sdram/*.v
|
| 18 |
+
|
| 19 |
+
vlog $p0 $p1 $i0 $i1 $i2 $i3 $i4 $s0 $s1 $s2 $s3 $s4
|
| 20 |
+
|
| 21 |
+
vsim work.mfp_testbench
|
| 22 |
+
|
| 23 |
+
add wave -radix hex sim:/mfp_testbench/*
|
| 24 |
+
|
| 25 |
+
run -all
|
| 26 |
+
|
| 27 |
+
wave zoom full
|
MIPSfpga_mipsfpga-plus/programs/01_light_sensor/main.c
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "mfp_memory_mapped_registers.h"
|
| 2 |
+
|
| 3 |
+
#define DELAY_VALUE (10*1024*1024)
|
| 4 |
+
|
| 5 |
+
void inline delay()
|
| 6 |
+
{
|
| 7 |
+
for (long i=0; i < DELAY_VALUE ; i++);
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
int main ()
|
| 11 |
+
{
|
| 12 |
+
int n = 0;
|
| 13 |
+
|
| 14 |
+
for (;;)
|
| 15 |
+
{
|
| 16 |
+
MFP_RED_LEDS = MFP_LIGHT_SENSOR >> 4;
|
| 17 |
+
MFP_7_SEGMENT_HEX = MFP_LIGHT_SENSOR;
|
| 18 |
+
MFP_GREEN_LEDS = n ++;
|
| 19 |
+
|
| 20 |
+
delay();
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
return 0;
|
| 24 |
+
}
|
MIPSfpga_mipsfpga-plus/programs/01_light_sensor/mfp_memory_mapped_registers.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef MFP_MEMORY_MAPPED_REGISTERS_H
|
| 2 |
+
#define MFP_MEMORY_MAPPED_REGISTERS_H
|
| 3 |
+
|
| 4 |
+
#define MFP_RED_LEDS_ADDR 0xBF800000
|
| 5 |
+
#define MFP_GREEN_LEDS_ADDR 0xBF800004
|
| 6 |
+
#define MFP_SWITCHES_ADDR 0xBF800008
|
| 7 |
+
#define MFP_BUTTONS_ADDR 0xBF80000C
|
| 8 |
+
#define MFP_7_SEGMENT_HEX_ADDR 0xBF800010
|
| 9 |
+
|
| 10 |
+
#define MFP_LIGHT_SENSOR_ADDR 0xB0404000
|
| 11 |
+
|
| 12 |
+
#define MFP_RED_LEDS (* (volatile unsigned *) MFP_RED_LEDS_ADDR )
|
| 13 |
+
#define MFP_GREEN_LEDS (* (volatile unsigned *) MFP_GREEN_LEDS_ADDR )
|
| 14 |
+
#define MFP_SWITCHES (* (volatile unsigned *) MFP_SWITCHES_ADDR )
|
| 15 |
+
#define MFP_BUTTONS (* (volatile unsigned *) MFP_BUTTONS_ADDR )
|
| 16 |
+
#define MFP_7_SEGMENT_HEX (* (volatile unsigned *) MFP_7_SEGMENT_HEX_ADDR )
|
| 17 |
+
#define MFP_LIGHT_SENSOR (* (volatile unsigned *) MFP_LIGHT_SENSOR_ADDR )
|
| 18 |
+
|
| 19 |
+
// This define is used in boot.S code
|
| 20 |
+
|
| 21 |
+
#define BOARD_16_LEDS_ADDR MFP_RED_LEDS_ADDR
|
| 22 |
+
|
| 23 |
+
#endif
|
MIPSfpga_mipsfpga-plus/programs/01_light_sensor/modelsim_script.tcl
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
vlib work
|
| 3 |
+
|
| 4 |
+
set p0 -vlog01compat
|
| 5 |
+
set p1 +define+SIMULATION
|
| 6 |
+
|
| 7 |
+
set i0 +incdir+../../../core
|
| 8 |
+
set i1 +incdir+../../../system_rtl
|
| 9 |
+
set i2 +incdir+../../../system_rtl/uart16550
|
| 10 |
+
set i3 +incdir+../../../testbench
|
| 11 |
+
set i4 +incdir+../../../testbench/sdr_sdram
|
| 12 |
+
|
| 13 |
+
set s0 ../../../core/*.v
|
| 14 |
+
set s1 ../../../system_rtl/*.v
|
| 15 |
+
set s2 ../../../system_rtl/uart16550/*.v
|
| 16 |
+
set s3 ../../../testbench/*.v
|
| 17 |
+
set s4 ../../../testbench/sdr_sdram/*.v
|
| 18 |
+
|
| 19 |
+
vlog $p0 $p1 $i0 $i1 $i2 $i3 $i4 $s0 $s1 $s2 $s3 $s4
|
| 20 |
+
|
| 21 |
+
vsim work.mfp_testbench
|
| 22 |
+
|
| 23 |
+
add wave -radix hex sim:/mfp_testbench/*
|
| 24 |
+
|
| 25 |
+
run -all
|
| 26 |
+
|
| 27 |
+
wave zoom full
|
MIPSfpga_mipsfpga-plus/programs/02_interrupts/main.c
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include <mips/cpu.h>
|
| 2 |
+
|
| 3 |
+
#include "mfp_memory_mapped_registers.h"
|
| 4 |
+
|
| 5 |
+
volatile int n;
|
| 6 |
+
|
| 7 |
+
void __attribute__ ((interrupt, keep_interrupts_masked)) general_exception_handler ()
|
| 8 |
+
{
|
| 9 |
+
unsigned cause = mips32_getcr (); // Coprocessor 0 Cause register
|
| 10 |
+
|
| 11 |
+
if (cause & CR_HINT0) // Checking whether interrupt 0 is pending
|
| 12 |
+
n = 0;
|
| 13 |
+
else if (cause & CR_HINT1) // Checking whether interrupt 1 is pending
|
| 14 |
+
n = 0x100000;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
int main ()
|
| 18 |
+
{
|
| 19 |
+
if (MFP_SWITCHES & 4) // Switch 2 is on
|
| 20 |
+
{
|
| 21 |
+
// Count without interrupts, polling buttons in the loop
|
| 22 |
+
|
| 23 |
+
for (n = 0;; n ++)
|
| 24 |
+
{
|
| 25 |
+
unsigned buttons = MFP_BUTTONS;
|
| 26 |
+
|
| 27 |
+
if (buttons & 1)
|
| 28 |
+
n = 0;
|
| 29 |
+
else if (buttons & 2)
|
| 30 |
+
n = 0x100000;
|
| 31 |
+
|
| 32 |
+
// Assigning to 7-segment indicator this value
|
| 33 |
+
// makes count visible with both slow and fast clock
|
| 34 |
+
|
| 35 |
+
MFP_7_SEGMENT_HEX = ((n >> 8) & 0xffffff00) | (n & 0xff);
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
else
|
| 39 |
+
{
|
| 40 |
+
// Count with interrupts, without polling buttons in the loop
|
| 41 |
+
|
| 42 |
+
// Clear boot interrupt vector bit in Coprocessor 0 Status register
|
| 43 |
+
|
| 44 |
+
mips32_bicsr (SR_BEV);
|
| 45 |
+
|
| 46 |
+
// Set master interrupt enable bit, as well as individual interrupt enable bits
|
| 47 |
+
// in Coprocessor 0 Status register
|
| 48 |
+
|
| 49 |
+
mips32_bissr (SR_IE | SR_HINT0 | SR_HINT1 | SR_HINT2 | SR_HINT3 | SR_HINT4 | SR_HINT5);
|
| 50 |
+
|
| 51 |
+
for (n = 0;;)
|
| 52 |
+
{
|
| 53 |
+
MFP_7_SEGMENT_HEX = ((n >> 8) & 0xffffff00) | (n & 0xff);
|
| 54 |
+
|
| 55 |
+
__asm__ volatile ("di"); // Disable interrupts
|
| 56 |
+
n ++;
|
| 57 |
+
__asm__ volatile ("ei"); // Enable interrupts
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
return 0;
|
| 62 |
+
}
|
MIPSfpga_mipsfpga-plus/programs/02_interrupts/mfp_memory_mapped_registers.h
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef MFP_MEMORY_MAPPED_REGISTERS_H
|
| 2 |
+
#define MFP_MEMORY_MAPPED_REGISTERS_H
|
| 3 |
+
|
| 4 |
+
#define MFP_RED_LEDS_ADDR 0xBF800000
|
| 5 |
+
#define MFP_GREEN_LEDS_ADDR 0xBF800004
|
| 6 |
+
#define MFP_SWITCHES_ADDR 0xBF800008
|
| 7 |
+
#define MFP_BUTTONS_ADDR 0xBF80000C
|
| 8 |
+
#define MFP_7_SEGMENT_HEX_ADDR 0xBF800010
|
| 9 |
+
|
| 10 |
+
#define MFP_RED_LEDS (* (volatile unsigned *) MFP_RED_LEDS_ADDR )
|
| 11 |
+
#define MFP_GREEN_LEDS (* (volatile unsigned *) MFP_GREEN_LEDS_ADDR )
|
| 12 |
+
#define MFP_SWITCHES (* (volatile unsigned *) MFP_SWITCHES_ADDR )
|
| 13 |
+
#define MFP_BUTTONS (* (volatile unsigned *) MFP_BUTTONS_ADDR )
|
| 14 |
+
#define MFP_7_SEGMENT_HEX (* (volatile unsigned *) MFP_7_SEGMENT_HEX_ADDR )
|
| 15 |
+
|
| 16 |
+
// This define is used in boot.S code
|
| 17 |
+
|
| 18 |
+
#define BOARD_16_LEDS_ADDR MFP_RED_LEDS_ADDR
|
| 19 |
+
|
| 20 |
+
#endif
|
MIPSfpga_mipsfpga-plus/programs/02_interrupts/modelsim_script.tcl
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
vlib work
|
| 3 |
+
|
| 4 |
+
set p0 -vlog01compat
|
| 5 |
+
set p1 +define+SIMULATION
|
| 6 |
+
|
| 7 |
+
set i0 +incdir+../../../core
|
| 8 |
+
set i1 +incdir+../../../system_rtl
|
| 9 |
+
set i2 +incdir+../../../system_rtl/uart16550
|
| 10 |
+
set i3 +incdir+../../../testbench
|
| 11 |
+
set i4 +incdir+../../../testbench/sdr_sdram
|
| 12 |
+
|
| 13 |
+
set s0 ../../../core/*.v
|
| 14 |
+
set s1 ../../../system_rtl/*.v
|
| 15 |
+
set s2 ../../../system_rtl/uart16550/*.v
|
| 16 |
+
set s3 ../../../testbench/*.v
|
| 17 |
+
set s4 ../../../testbench/sdr_sdram/*.v
|
| 18 |
+
|
| 19 |
+
vlog $p0 $p1 $i0 $i1 $i2 $i3 $i4 $s0 $s1 $s2 $s3 $s4
|
| 20 |
+
|
| 21 |
+
vsim work.mfp_testbench
|
| 22 |
+
|
| 23 |
+
add wave -radix hex sim:/mfp_testbench/*
|
| 24 |
+
|
| 25 |
+
run -all
|
| 26 |
+
|
| 27 |
+
wave zoom full
|
MIPSfpga_mipsfpga-plus/programs/03_cache_misses/main.c
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include "mfp_memory_mapped_registers.h"
|
| 2 |
+
|
| 3 |
+
int a [8][8];
|
| 4 |
+
|
| 5 |
+
int main ()
|
| 6 |
+
{
|
| 7 |
+
int n = 0;
|
| 8 |
+
int i, j;
|
| 9 |
+
|
| 10 |
+
// Wait for switch 2
|
| 11 |
+
|
| 12 |
+
while ((MFP_SWITCHES & 4) == 0)
|
| 13 |
+
;
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
for (i = 0; i < 8; i ++)
|
| 17 |
+
for (j = 0; j < 8; j ++)
|
| 18 |
+
// a [i][j] = i + j;
|
| 19 |
+
a [j][i] = i + j;
|
| 20 |
+
|
| 21 |
+
return 0;
|
| 22 |
+
}
|
MIPSfpga_mipsfpga-plus/programs/03_cache_misses/mfp_memory_mapped_registers.h
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef MFP_MEMORY_MAPPED_REGISTERS_H
|
| 2 |
+
#define MFP_MEMORY_MAPPED_REGISTERS_H
|
| 3 |
+
|
| 4 |
+
#define MFP_RED_LEDS_ADDR 0xBF800000
|
| 5 |
+
#define MFP_GREEN_LEDS_ADDR 0xBF800004
|
| 6 |
+
#define MFP_SWITCHES_ADDR 0xBF800008
|
| 7 |
+
#define MFP_BUTTONS_ADDR 0xBF80000C
|
| 8 |
+
#define MFP_7_SEGMENT_HEX_ADDR 0xBF800010
|
| 9 |
+
|
| 10 |
+
#define MFP_RED_LEDS (* (volatile unsigned *) MFP_RED_LEDS_ADDR )
|
| 11 |
+
#define MFP_GREEN_LEDS (* (volatile unsigned *) MFP_GREEN_LEDS_ADDR )
|
| 12 |
+
#define MFP_SWITCHES (* (volatile unsigned *) MFP_SWITCHES_ADDR )
|
| 13 |
+
#define MFP_BUTTONS (* (volatile unsigned *) MFP_BUTTONS_ADDR )
|
| 14 |
+
#define MFP_7_SEGMENT_HEX (* (volatile unsigned *) MFP_7_SEGMENT_HEX_ADDR )
|
| 15 |
+
|
| 16 |
+
// This define is used in boot.S code
|
| 17 |
+
|
| 18 |
+
#define BOARD_16_LEDS_ADDR MFP_RED_LEDS_ADDR
|
| 19 |
+
|
| 20 |
+
#endif
|
MIPSfpga_mipsfpga-plus/programs/03_cache_misses/modelsim_script.tcl
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
vlib work
|
| 3 |
+
|
| 4 |
+
set p0 -vlog01compat
|
| 5 |
+
set p1 +define+SIMULATION
|
| 6 |
+
|
| 7 |
+
set i0 +incdir+../../../core
|
| 8 |
+
set i1 +incdir+../../../system_rtl
|
| 9 |
+
set i2 +incdir+../../../system_rtl/uart16550
|
| 10 |
+
set i3 +incdir+../../../testbench
|
| 11 |
+
set i4 +incdir+../../../testbench/sdr_sdram
|
| 12 |
+
|
| 13 |
+
set s0 ../../../core/*.v
|
| 14 |
+
set s1 ../../../system_rtl/*.v
|
| 15 |
+
set s2 ../../../system_rtl/uart16550/*.v
|
| 16 |
+
set s3 ../../../testbench/*.v
|
| 17 |
+
set s4 ../../../testbench/sdr_sdram/*.v
|
| 18 |
+
|
| 19 |
+
vlog $p0 $p1 $i0 $i1 $i2 $i3 $i4 $s0 $s1 $s2 $s3 $s4
|
| 20 |
+
|
| 21 |
+
vsim work.mfp_testbench
|
| 22 |
+
|
| 23 |
+
add wave -radix hex sim:/mfp_testbench/*
|
| 24 |
+
|
| 25 |
+
run -all
|
| 26 |
+
|
| 27 |
+
wave zoom full
|