DLX MultiCycle Implementation: Due Feb 25 at Class Time
Introduction
The goal of this simulation is to introduce the student to the
concept of multicycle control for an ISA. You will
be given a VHDL model of the multi-cycle implementation as discussed
in the textbook. Your job will be to
extend the multicycle implementation to handle BNEZ, immediate
adds/subtracts (both signed and unsigned), and all of the byte/half-word
loads/stores. Your program must be able to
successfully execute both acid_test.s and mem_test.s programs we used
to test the single cycle implementation.
Set Up
Copy the file '~reese/vhdl.tar.Z.sim3' from my ECE acccount to your local directory. Unpack this
compressed tar file by doing:
% cat vhdl.tar.Z.sim3 | zcat | tar xf -
This will create the directory development tree like the one you used for previous
VHDL simulation assignments( You will need to delete the directory tree
used previously). For PC users, the file you need is called
'sim3.zip'.
This model runs 'as is'; it implements the multi-cycle control discussed in the book.
You can test it by doing:
qhsim -lib ../obj/qhdl/dlxmcyc cfg_mcyc_test
This loads the 'mcyc_test.obj' file which was produced from 'mcyc_test.s' The correct
register values at the end of the simulation are specified in
'mcyc_test.s'. This is a very simple test with just a few instructions.
What You Have To Do
Your job will be to extend the multicycle implementation to handle
BNEZ, immediate adds/subtracts (both signed and unsigned), and all of
the byte/half-word loads/stores. Your program must be able to
successfully execute both the acid_test.s (cfg_acid_test)
and mem_test.s (cfg_mem_test) programs we used
to test the single cycle implementation.
Tips
This task is more challenging than previous assignments. You will
probably end up editing both 'dlx.vhd' and 'control.vhd' to get the
job done. Before you write any VHDL code you should do the following:
- Understand the current code! You should read 'dlx.vhd',
'control.vhd' and understand what is going on; you should read
the comments at the top of 'dlx.vhd' to see how this implementation
differs from the textbook.
- Adding support for the other instructions involves adding new
states; you should add them to the state diagram and understand what
control lines need to be affected in each added state.
.
Adding States to 'control.vhd'
You may find it necessary to add one or more states to the control. To
do this, you should:
- Pick a name for the state and a state encoding and add it as
a CONSTANT declaration as the other states are done. You MUST pick
a unique state encoding; if you don't then your code will NOT operate
correctly.
- Enter the code for the new state in the CASE statement which
implements the logic for the control finite state machine. Remember,
you have to modify an old state to check for some condition that
makes it jump to your new state, and your new state must sequence
to some other state (perhaps another new state, perhaps an existing
state).
Adding a new port to a VHDL model
You may also find it necessary to add a new port (either
input or output) to a VHDL model. For example, assume we adding a
new output signal to the 'control.vhd' code. You should:
- Add it to the port list of the entity declaration.
- Add it to the process block. If it is an output, you
should assign it some default value. If it is an input, you
need to add it to the sensitivity list of the process block.
- In 'dlx.vhd', add the signal to the component declaration
for 'control.vhd'.
- In 'dlx.vhd', add the signal to the 'port map' of the
control block instance; you will need to connect it to some signal
or port declared in 'dlx.vhd'. If it is an internal signal (not
an external port), you will need to declare this internal signal.
To Turn In
You must turn in hardcopy of any files you have modified with
your changes HIGHLIGHTED so I can easily see what you did. Print
these files out in double column format to save paper.
You must also do the following submission procedure:
- Create a directory called 'sim3'.
- Copy ONLY the vhdl files which you have modified to this
directory.
- Put a README file in the 'sim3' directory which tells me the
status of your simulation (working or not working, if not working,
then describe what is broken).
- Execute the script '~reese/bin/submit_sim3.sh' from the directory
ABOVE the 'sim3' directory (from the current directory, you should be
able to see 'sim3' as a subdirectory). This will pack up the contents
of the 'sim3' directory and email them to me.
It will NOT be necessary to demo your code to me; I will check it.
If I have problems with your code I will contact you.