Line 8... |
Line 8... |
'Hello world' demo and a memory tester. Only the 'hello' demo is included
|
'Hello world' demo and a memory tester. Only the 'hello' demo is included
|
in pre-generated form, the others have to be built using the included
|
in pre-generated form, the others have to be built using the included
|
makefiles -- assuming you have a mips toolchain.\\
|
makefiles -- assuming you have a mips toolchain.\\
|
|
|
'Pre-generated' in this context means that all the vhdl files necessary for
|
'Pre-generated' in this context means that all the vhdl files necessary for
|
building the demo are already included with the project, and the only
|
building the demo are already included with the project, including the
|
|
configuration package that contains the program's object code, and the only
|
tool needed is the synthesis tool.
|
tool needed is the synthesis tool.
|
|
|
The pregenerated demo is included just for convenience, so that you can
|
The pregenerated demo is included just for convenience, so that you can
|
launch some small application on hardware without installing a C toolchain.\\
|
launch some small application on hardware without installing a C toolchain.\\
|
|
|
Line 40... |
Line 41... |
This choice tells the synth tool what speed grade and chip package
|
This choice tells the synth tool what speed grade and chip package
|
we'll be targetting.
|
we'll be targetting.
|
\item 'Next' your way out of the new project wizard.
|
\item 'Next' your way out of the new project wizard.
|
\item Add to the project all the vhdl files in /vhdl and /vhdl/demo,
|
\item Add to the project all the vhdl files in /vhdl and /vhdl/demo,
|
except mips\_cache\_stub.vhdl and sdram\_controller.vhdl.
|
except mips\_cache\_stub.vhdl and sdram\_controller.vhdl.
|
|
\item Add to the project all the vhdl files in /vhdl/SoC.
|
\item Select file c2sb\_demo.vhdl as top.
|
\item Select file c2sb\_demo.vhdl as top.
|
\item Import pin constraints file (assignments-\textgreater import assignments).
|
\item Import pin constraints file (assignments-\textgreater import assignments).
|
\item Create a clock constraint for signal clk (51 MHz or some other
|
\item Create a clock constraint for signal clk (51 MHz or some other
|
suitable speed which gives us some minimal slack).
|
suitable speed which gives us some minimal slack).
|
\item In the device settings window, click "Device and pin options...".
|
\item In the device settings window, click "Device and pin options...".
|
\item Select tab "Dual-Purpose pins".
|
\item Select tab "Dual-Purpose pins".
|
\item Double-click on nCEO value column and select "use as regular I/O".
|
\item Double-click on nCEO value column and select "use as regular I/O".
|
IMPORTANT: otherwise the synthesis will fail; we need to use a FPGA
|
IMPORTANT: otherwise the synthesis will fail; we need to use a FPGA
|
pin that happens to be dual-purpose (programming and regular).
|
pin that happens to be dual-purpose (programming and regular).
|
\item Select 'balanced' optimization.
|
\item Select 'speed' optimization.
|
\item Save the project and synthesize.
|
\item Save the project and synthesize.
|
\item Make sure the clock constraint is met (timing analyzer report).
|
\item Make sure the clock constraint is met (timing analyzer report).
|
There is a random element to the synthesis process, as you know,
|
There is a random element to the synthesis process, as you know,
|
but the core as shipped should pass the constraint.
|
but the core as shipped should pass the constraint.
|
\item Program the FPGA from Quartus-2
|
\item Program the FPGA from Quartus-2
|
\item If you have a terminal hooked to the serial port (19200/8/N/1) you
|
\item If you have a terminal hooked to the serial port (19200/8/N/1) you
|
should see a welcome message after depressing the reset button.
|
should see a welcome message after depressing the reset button.
|
(by default this is pusbutton 2).
|
(by default this is pushbutton 2).
|
|
|
\end{enumerate}
|
\end{enumerate}
|
|
|
In the present version, the synthesis will produce a lot of warnings. The
|
In the present version, the synthesis will produce a lot of warnings. The
|
ugliest are about unused pins and an undeclared clock line. None of them
|
ugliest are about unused pins and an undeclared clock line. None of them
|
should be really scary.\\
|
should be really scary.\\
|
Line 86... |
Line 87... |
|
|
The 'hello' demo should be easily portable to any board which has all of
|
The 'hello' demo should be easily portable to any board which has all of
|
this:
|
this:
|
|
|
\begin{itemize}
|
\begin{itemize}
|
\item An FPGA capable enough (the demo uses internal memory for code)
|
\item An FPGA capable enough (the demo uses internal memory for code).
|
\item At least 4KB of 16-bit wide external, asynchronous, old-fashioned SRAM
|
\item At least 4KB of 16-bit wide external, asynchronous, old-fashioned SRAM.
|
\item A reset pin (possibly a pushbutton)
|
\item A reset pin (possibly a pushbutton).
|
\item A clock input (uart modules assume 50MHz, see below)
|
\item A clock input (uart modules assume 50MHz, see below).
|
\item RXD and TXD UART pins, plus a connector, header or whatever
|
\item RXD and TXD UART pins, plus a connector, header or whatever.
|
\end{itemize}
|
\end{itemize}
|
|
|
The only modules that care at all about clock rate are the UART
|
The only module that care at all about clock rate is the UART embedded into
|
modules. They are hardwired to 19200 bauds when clocked at 50MHz, so if you
|
the SoC module. It's hardwired to 19200 bauds when clocked at 50MHz, so if you
|
use a different frequency you must edit the generics in the demo entity
|
use a different frequency you must edit the generics in the demo entity
|
accordingly.\\
|
accordingly -- the demo generics are passed all the way down to whatever
|
Be aware that these uart modules have been used a lot in other projects but
|
module needs them.\\
|
have not been tested with a wide range of clock rates; they should work but
|
The UART has hardly been tested at clock rates other than 50MHz and has not
|
you have been warned.\\
|
passed any independent test bench; try the core first at 50 MHz.\\
|
|
|
Though there is no reset control logic, the reset input is synchronized
|
Though there is no reset control logic, the reset input is synchronized
|
internally, so you can use a raw pushbutton -- you may trigger multiple
|
internally, so you can use a raw pushbutton -- you may trigger multiple
|
resets if your pushbutton isn't tight but you'll never cause metastability
|
resets if your pushbutton isn't tight but you'll never cause metastability
|
trouble.\\
|
trouble.\\
|
|
|
Assuming you take care of all of the above, the easiest way I see to port
|
Assuming you take care of all of the above, the easiest way I see to port
|
the demo is just editing the top module ports ('/vhdl/demo/c2sb\_demo.vhdl')
|
the demo is just editing the top module ports ('/vhdl/demo/c2sb\_demo.vhdl')
|
to match your board setup.\\
|
to match your board setup. The only tricky part is the interface to FLASH
|
|
and SDRAM.\\
|
|
|
All the code in this project is vendor agnostic (or should be, I have only
|
All the code in this project is vendor agnostic (or should be, I have only
|
tried it on Quartus and ISE). Specifically, it does not instantiate memory
|
tried it on Quartus and ISE). Specifically, it does not instantiate memory
|
blocks (relying instead on memory inference) or clock managers or buffers.
|
blocks (relying instead on memory inference) or clock managers or buffers.
|
This has its drawbacks but is an stated goal of the project -- in the long
|
This has its drawbacks but is an stated goal of the project -- in the long
|
Line 146... |
Line 148... |
On the other hand, when you get to the \emph{maze of twisty little passages}
|
On the other hand, when you get to the \emph{maze of twisty little passages}
|
you know you have a computer, finished or not. The 'Adventure' demo is
|
you know you have a computer, finished or not. The 'Adventure' demo is
|
great as a confidence builder.\\
|
great as a confidence builder.\\
|
|
|
Besides, running Adventure on a computer built by myself is something
|
Besides, running Adventure on a computer built by myself is something
|
I just wanted to do :)\\
|
I've always wanted to do :)\\
|
|
|
No newline at end of file
|
No newline at end of file
|