This article was reviewed by Luigi Oppido and by wikiHow staff writer, Carmine Shannon. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over 7 years.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 1,888 times.
1ps is a unit of measurement in the Verilog timescale compiler directive. It stands for 1 picosecond, or 1 trillionth of a second. The `timescale directive, which determines the unit of time for a simulation and rounds the outputs, can be tricky, so keep reading to see how to set up a module and record outputs in Verilog.
1ps in Verilog Timescale
1ps stands for 1 picosecond, which is equal to 1 trillionth of a second, and refers to one unit in Verilog timescale. The `timescale directive is written as `timescale [time unit]/[resolution]. The first unit sets the timescale of the module, and the resolution sets how far the outputs are rounded.
Steps
How to Use the Verilog Timescale Directive
-
Choose your units of time and resolution. In Verilog, the timescale directive is written as `timescale integer [time unit] / integer [resolution]. When choosing your units, always put the larger one first. The general time scale must be divisible by the resolution.[2]
-
Choose your integers (order of magnitude). Finish setting the timescale by choosing one of three integers to put before your units: 1, 10, or 100. By adding an integer you can control how much time makes up a single unit or how many units go into the resolution.
- For example, if you write the directive `timescale 10ns / 1ns, then for every 10 nanoseconds the output value will be rounded to the nearest nanosecond.
- A common timescale is 1ns / 1ps, which means at each nanosecond there is an output rounded to the nearest picosecond.
-
Write your test bench module. Test benches run a simulation of your design, and check the outputs. Set up your module by writing:
- `timescale [unit of time]/[unit of precision]
- module tb;
- reg val;
- initial begin
- val<=[where you want to start];
-
Set delays by writing #[real number] before your functions. To program when your data is recorded, write the operator #[real number] and then a function. The operator # (AKA the delay) is multiplied by the time unit, then rounded to the nearest time precision unit (resolution). For example, you could write
- #5 $display (“T=%0t At time #5”, $realtime);
- val<=1;
- If your `timescale is 1ns/1ns, then your output would be 1(ns) * 5 = 5 since it’s rounded to the nearest nanosecond.
- If your `timescale was 10ns/1ns, then your output would be 10(ns) * 5 = 50.
- If your `timescale was 1ns/1ps, then your output would be 1000ps (AKA 1ns) * 5 = 5000 to convert it to picoseconds.
-
Set the end time and add the ending code. To end the simulation, write #[real number] before the function $display (“T=%0t End of simulation”, $realtime); then write the codes “end,” then “endmodule”. “End” closes the block “initial begin,” and “endmodule” closes the “module” block.
- Your entire simulation may look like this:
- `timescale 1ns/1ps
- module tb;
- reg val;
- initial begin
- val<=0;
- #1 $display (“T=%0 At time #1”, $realtime);
- val<=1;
- #5 $display (“T=%0t End of simulation”, $realtime);
- end
- endmodule
- Your entire simulation may look like this:
Other Meaning of 1ps
-
1ps can mean first-person shooter when referring to gaming. Video games that are in first-person perspective are often called first-person shooters, more often abbreviated as FPS. Occasionally, they’re also abbreviated to “1ps.”
-
In math, IPS stands for inches per second. Sometimes, IPS refers to a unit of measurement for acceleration, which is inches per second.[5] When it’s being used for a change in velocity (acceleration), it’s written as inches per second2.
-
IPS can also refer to a kind of LCD screen. IPS (in-plane switching) monitors are a kind of LCD screen where liquid crystals are sandwiched between two planes of glass.[6]
-
IPSs are a kind of computer security system. IPS can also mean “intrusion prevention systems,” which block attacks on networks and computers.[7]
Expert Q&A
Tips
-
EDA Playground is a free online Verilog simulator.Thanks
References
- ↑ https://fpga.mit.edu/6205/_static/F23/documentation/1800-2017.pdf
- ↑ https://fpga.mit.edu/6205/_static/F23/documentation/1800-2017.pdf
- ↑ https://fpga.mit.edu/6205/_static/F23/documentation/1800-2017.pdf
- ↑ https://verilogams.com/refman/basics/directives.html
- ↑ https://www.aqua-calc.com/what-is/acceleration/inch-per-second-squared
- ↑ https://www.pcmag.com/encyclopedia/term/ips
- ↑ https://www.pcmag.com/encyclopedia/term/ips




![Step 4 Set delays by writing #[real number] before your functions.](https://www.wikihow.com/images/thumb/d/db/1ps-Meaning-Step-5.jpg/v4-460px-1ps-Meaning-Step-5.jpg)






