- Bring in components for clock divider, 7 segment display, FSM template, DE10-lite `attribute chip_pin` mappings and all lab materials at the minimum.
- Save time, you will not have enough time for mistakes
- Use `attribute chip_pin` to avoid using the pin planner (saves mouse-clicks and time). See section [`attribute chip_pin` section](#attribute-chip_pin) of this page for pin mappings (adapted from DE10-lite manual).
- Use a mouse, you will not have time for trackpad.
- Focus on getting a working design before moving on to another design, they will only give one mark if your design has code, but you can't demonstrate it working (mock lab test). If your working design has a bug then they don't take too many marks away in my experience (mock lab test: I had a speed switch erroneously affect both speed and direction of a FSM - this only copped a 1 mark penalty in the mock lab test).
- **NOTE: Check for your current year**. As of 2024, you may use your personal computer in the test and you don't need to use the lab computers (subject to same restrictions). You may not use anything other than Altera Quartus, Modelsim and Adobe Acrobat. You _cannot_ use vscode.
- Make a few project files and the directory structure before the test, DO NOT put modelsim project in the same directory as code.
- Test top-level block, but modifications can be made to make it more readable for testbench
- Example: Instead of 50MHz clock_in, make it something more reasonable like 2Hz so the clock divider does not have to pulse 50 million times for one cycle
- Example: If it has a 7 segment display output instead of testing the display outputs just directly put the number out in the test bench version.
- Examples from source _Mock Lab test part 2 solutions/Part 3 building the simulation_
- It might be easier just to copy-paste the whole code and change the constants instead of making it generic which needs to be instantiated again
```tcl
# Start simulation and add all waves
vsim $TESTBENCH_ID -voptargs=+acc; add wave *
# Recompile and restart simulation (if file modified)
project compileoutofdate; restart -force; run -all
- Use Questasim/Modelsim for syntax checking, a lot of time was wasted in the lab test waiting for quartus analysis to complete to check syntax, whereas modelsim can check it instantly. Use the command `project compileall` in the tcl console if you don't want to right-click > compile all every time you save a file (use up arrow to repeat last command instead of retyping it).
- Double-click a line in the compile results to see the detailed errors for that file\
Example:
```text
Questa> project compileall
# Compile of clk_div.vhd was successful.
# Compile of fsm.vhd failed with 1 errors. <--- double click on this to see errors in fsm.vhd in a new window
- I recommend fixing errors in modelsim editor instead of alt-tabbing between modelsim and quartus to fix errors. when going back to quartus you will need to press 'yes' when it asks if you want to overwrite local changes.
- Inertial `O <= Expr AFTER 10 ns;` (Inertial delay: `10 ns`, same as transport component)
- Delta time `O <= Expr` (Implicit - delta time is applied to concurrent statements when a statement is dependent on the output of a previous one. Expressions which can be executed concurrently have the same delta time)
Make table like this for delta time (required for followthrough marks):
Past exam papers are not provided, but from my 2024 experience the workshops and past tests are more than adequate for the exam questions.
If you need more questions, search "**ENGT2301**" on OneSearch. You will find a 2005 paper (note the 2005 deferred has the same questions). There's some obsolete questions involving JK flip-flops, but there's some useful ones on timing, state machines and path sensitization.
### **2024 EXAM OUTLINE IMPORTANT**
This was quoted from the final lecture.
- 5 questions x 20 marks
- **1** Testing 25 marks
- No _XOR method_ (XOR can be used still for validation)
- Path sensitization
- **2** Read VHDL (???)
- **3** VHDL -> Draw circuit
- **4** Circuit -> VHDL
- **5** Timing question (practical 5)
- 10 marks allocated to general questions
- NOTE: In the 2024 examination, calculators were allowed which was useful for the timing questions.
### Implementation technologies
- No practice questions, but may have worded questions
My recommendation is to use `qrun` and do things in the terminal with `assert`s instead of trying to do it graphically using the verification diagrams. It also is much quicker.
For some reason, I can't get incremental compilation working and it just causes more issuse than the time it saves right now, since it results in changes not affecting the simulation, so for now I am cleanly rebuilding each simulation.
In GUI mode, manually start the simulation. When you need to update the simulation run this commandline
<!--
```bash
qrun $FILE_NAME -optimize -cleanlib -top $TOP_LEVEL_ENTITY; restart -force; run -all
``` -->
```bash
project compileoutofdate; restart -force; run -all
⚠ TODO: Fix previous issue in GUI as well (I am now using qrun instead of the GUI).
This is because the signals are being optimized out since they aren't really used for anything useful.
The intel questa/modelsim version shipped with the unit is 18.1, but this allowed vopt to be disabled. This is no longer the case on the latest versions of intel questa (You will get a compile error if you disable vopt flow).
Go to `Simulate > Start Simulation...`, ensure optimization is enabled then click on `Optimization Options...`