- 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):
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...`
- No _XOR method_ (XOR can be used still for validation)
- Path sensitization
- **2** Read VHDL (??? so probably a delta time question)
- **3** VHDL -> Draw circuit
- **4** Circuit -> VHDL
- **5** Timing question (practical 5)
- 10 marks allocated to general questions
### Implementation technologies
- No practice questions, but may have worded questions
Partitioning
> Yeah, you can implement, you know, in any any function,
> uh, partition is important to understand why we do partitioning.
> I'm not gonna ask you this, OK, because, uh, you
> know, some of you may have forgotten this.
> Uh, we're going at a bit a bit higher level,
> Uh, but it's good to to to to know what
> is behind, uh, below the the surface.
> Uh uh, So there won't be any problems per SE.
> It's more, uh, an overview of of of the FPG.
> Uh, so I want to ask you to implement, but
> I may ask you questions.
> You know why, uh, why do we you know, why
> would we need a large look up table or whatever?
> Any questions?
> All right.
PAL > CPLD > FPGA > standard cell > custom design
### LECTURES TO WATCH
- [(low-med priority, has a video which might be asked in final) Digital System Design - ELEC2311_SEM-2_2024 / ELEC2311 - 17 Sep 2024, 10:00 - Lecture - Tue 17, Sept](https://echo360.net.au/lesson/G_d242de04-466c-4e5c-90c5-8559bf05817a_f680b162-bea0-4466-ba23-9c4e4e8608f4_2024-09-17T09:58:00.000_2024-09-17T11:52:00.000/classroom)
- [(low priority, already tested to success) Digital System Design - ELEC2311_SEM-2_2024 / ELEC2311 - 18 Sep 2024, 09:00 - Lecture - Wed 18, Sept](https://echo360.net.au/lesson/G_cd2b8e85-7208-4aef-bd38-9ec27622ec31_f680b162-bea0-4466-ba23-9c4e4e8608f4_2024-09-18T08:58:00.000_2024-09-18T09:52:00.000/classroom)