TT Lab
Get started
Learn Learning paths Courses

My Cable Has an Echo

A successful simulation is not completed validation

Continue in TT Lab

In one line

A calculator's exit code of 0 does not mean the answer is right. Only when the circuit conditions, the waveform, the analysis code, and the limits of the model are linked together can someone else review the result again.

Why this was needed

You got a beautiful graph. But if you entered the propagation time at double the right value, or read yesterday's CSV, the graph faithfully shows the wrong circuit. There is a gap between the program having finished and its having answered the question you wanted. This module fills that gap with tests and file evidence.

There are also omissions in the claim "we put in a termination resistor". A previous waveform saved under the same file name, a time column without units, a table that left out the input voltage, and a summary missing one tolerance combination all make a re-review hard. The final task is not a report with long sentences but a small list of links that lets you confirm which model, code, and data were used.

How it works

The lab's generator takes only the numbers from JSON, builds a fixed ngspice netlist, and actually runs it. model.cir stores the circuit, trace.csv the four columns time_s, drive_v, tx_v, and rx_v, and run.json the input model, the sample count, the received maximum, and the file hashes. The supply input column must also be there so that you can distinguish a wrong input from an output circuit problem.

The time step is not just a graph resolution setting. It affects how closely the numerical calculation follows the edges and changes. In the lab you run the series termination model at maximum time steps of 0.02ns and 0.01ns respectively. ngspice can place extra samples where needed, so you must not assume that the row numbers of the two CSVs mean the same time.

The comparison convention is to linearly interpolate the fine waveform at every time of the coarse waveform and find the maximum of the absolute values of the TX and RX voltage differences. The input column is excluded from this function's comparison. It assumes that the times of the two waveforms are in ascending order, have the same start and end, and have at least two points. It does not extrapolate beyond the range, and the returned unit is V.

Consider a simple example. If the fine waveform is 1V at 1 second and 3V at 3 seconds, the value at 2 seconds is 2V by linear interpolation. If the coarse waveform's sample at 2 seconds is 2.1V, the difference at that point is 0.1V. If you compare by row number, you could wrongly judge the 2-second value against 3 seconds as a 0.9V difference. The real lab is on an ns scale, but the interpolation method itself is the same.

That the difference gets smaller when you shrink the step is useful numerical evidence. But if you calculated the same wrong model twice, they can agree with each other. So besides comparing with a new solver run, the grader also checks the first three plateaus with a separate reflection recurrence. The independent reference still uses the same ideal-line assumption, so it does not guarantee real-hardware accuracy.

A file hash answers a different question. Not "is this result right?" but "is the file we reviewed that file?" A SHA-256 string changes if the file content changes, but a wrong circuit can have its own hash too. So just modifying trace.csv and recomputing the hash in run.json does not make it a correct experiment. Grading also compares the file contents and the real circuit response.

In the final release.json you write model_type as ideal_single_mode_lossless, measured and pcb_certified as false, and target_verification_required as true. This is not decoration for disclaimers but a statement of the scope performed. These are fields to keep you from calling a numerical experiment a real measurement, or turning passing a transmission line example into certification of a whole PCB. Real-hardware verification must be proven by separate experiments later.

The sha256 object uses as keys the relative paths the step card specifies. It links the waveform, the run report, the input JSON, the Python analysis, and the list of tolerance maxima. If you change the keys to absolute paths or arbitrarily put in even backup files, it differs from the promised report format. If you modified the analysis code, you must recheck the results and rewrite the hashes at the end.

What it looks like in the field

This lab targets learners who can use basic shell commands and Python functions, lists, and dictionaries. Create a working folder with mkdir, and do not wrap JSON numbers in quotes. The values returned by csv.DictReader are strings, so you must convert them to float before you can calculate. If you first match the file names, function arguments, and return keys, you need not spend time guessing formats.

For analysis functions, use return values instead of screen output. The grader passes various inputs to a new process and reads the JSON result, so a debug print mixed in breaks the result format. NaN and infinity are not allowed. Function execution has CPU, memory, time, and output limits, and an infinite loop is reported as an execution failure, not a wrong answer. These limits are different from the study time limit.

The output folder of the circuit generator must be a new name. It refuses to overwrite the same folder in order to preserve earlier results. If you rerun the answer view, an existing file or folder is kept under a separate name with previous attached and a new result is produced. After finishing the comparisons you need, check again which files you treated as the submission. Having a backup does not mean it is preserved after the session ends.

The expected lab time is 75 minutes. You must extend with +time before the default 60-minute session ends, up to a maximum of 180 minutes. Distinguish the time spent reading the theory from the lab time, and copy your source and report to your own storage before it ends. The Pod has no persistent storage volume, so you cannot recover terminal files after it ends. No real equipment connection or external package installation is needed.

What you will do in the next lab

You complete, in order, reference waveform generation, the threshold-voltage arrival time, the reflection formula implementation, series termination, parallel termination and power, nine tolerance combinations, the time-step comparison, and the final evidence report. In the intermediate steps it is normal that the next step does not yet pass. The last grading also rechecks the files of the earlier steps, so you cannot substitute a report with only numbers written in.