526lec4-5 - 2/5/2010 `timescale Directive ECE 526 Compiler...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
2/5/2010 1 ECE 526 Compiler Directives `timescale Directive • Timescales use two numbers: the reference time unit and the precision. • The first number sets the unit of 2 The first number sets the unit of measurements for times and delays. • The second sets the precision, that is, the smallest unit of time that the simulator will track without rounding. `timescale Rules • `timescale uses back tick (`), not an apostrophe (‘). • The units of measurement can never be less 3 than the precision. – i.e. `timescale 1 ns / 10 ns is ILLEGAL • Only 1, 10 and 100 are valid numbers for specifying either time units or precision. – i.e. `timescale 1 ns / 500 ps is ILLEGAL `timescale is a Directive • `timescale is a Compiler Directive. • This means that it does NOT follow certain Verilog HDL conventions 4 Verilog HDL conventions. – 1. The directive does NOT end in a semicolon. – 2. It is set BEFORE the module/endmodule structure. Meaning of Timescale Numbers • Each Timescale directive has two numbers: – `timescale 100 ps / 10 ps • The first number says what the units of time 5 in the file are going to mean. – #10 CLK <= 1’b0; – Wait for 10 time units , then assign a value of zero to signal CLK. – 10 time units means 1 ns here. Examples of Good `timescale Directives • `timescale 1 ns / 1 ns • `timescale 1 ns / 100 ps `timescale 100 ps / 10 p 6 timescale 100 ps / 10 ps
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2/5/2010 2 `timescale Compiler Directive • `timescale compiler directive specifies the time unit and its precision, which is used in measuring times and delays. It has the following format: `timescale <time_unit>/ <time_precision> 7 Where: <time_unit> specifies the time unit. <time_precision> specifies the precision used in rounding delay values before using them in simulation. `timescale Compiler Directive • Each of <time_unit> or <time_precision> consists of an integer, to represent the magnitude, followed by a time unit specifier. • The valid values of the magnitude are 1, 10, 100 . • The valid time unit specifiers are: s (second), ms (millisecond) = 10E-3 second, 8 us (microsecond) = 10E-6 second, ns (nanosecond) = 10E-9 second, ps (picosecond) = 10E-12 second, and fs (femtosecond) = 10E-15 second. • The `timescale compiler directive must be written outside the boundary of the modules. • <time_precision> must be at least as small as the <time_unit> . Timescale Resolution • The second timescale number specifies the granularity in which the simulation will be run. 9 – `timescale 100 ps / 10 ps • This will cause rounding for any unit of time less than 10 ps. – and #1.26 ANDGATE1(OUT, IN1, IN2); • OUT will change 130 ps after IN1 or IN2 `timescale Compiler Directive The time unit of the simulation is determined by the smallest value of all the timescale directives. `timescale 10 ms/ 1 ms
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 02/27/2010.

Page1 / 9

526lec4-5 - 2/5/2010 `timescale Directive ECE 526 Compiler...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online