Verilog Programming part 29

Time Scales Often, in a single simulation, delay values in one module need to be defined by using certain time unit, ., 1 µs, and delay values | Time Scales Often in a single simulation delay values in one module need to be defined by using certain time unit . 1 gs and delay values in another module need to be defined by using a different time unit . 100 ns. Verilog HDL allows the reference time unit for modules to be specified with the timescale compiler directive. Usage timescale reference_time_unit time_precision The reference_time_unit specifies the unit of measurement for times and delays. The time_precision specifies the precision to which the delays are rounded off during simulation. Only 1 10 and 100 are valid integers for specifying time unit and time precision. Consider the two modules dummyl and dummy2 in Example 9-8. Example 9-8 Time Scales Define a time scale for the module dummy1 Reference time unit is 100 nanoseconds and precision is 1 ns timescale 100 ns 1 ns module dummy1 reg toggle initialize toggle initial toggle 1 b0 Flip the toggle register every 5 time units In this module 5 time units 500 ns .5 s always 5 begin toggle -toggle display d In m toggle b time toggle end endmodule Define a time scale for the module dummy2 Reference time unit is 1 microsecond and precision is 10 ns timescale 1 us 10 ns module dummy2 reg toggle initialize toggle initial toggle 1 b0 Flip the toggle register every 5 time units In this module 5 time units 5 s 5000 ns always 5 begin toggle -toggle display d In m toggle b time toggle end endmodule The two modules dummy1 and dummy2 are identical in all respects except that the time unit for dummy1 is 100 ns and the time unit for dummy2 is 1 ps. Thus the display statement in dummy1 will be executed 10 times for each display executed in dummy2. The time task reports the simulation time in terms of the reference time unit for the module in which it is invoked. The first few display statements are shown in the simulation output below to illustrate the effect of the timescale directive. 5 In dummy1 toggle 1 10 In dummy1 toggle 0 15 In dummy1 toggle 1 20 In .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU LIÊN QUAN
5    176    1
5    255    1
5    106    0
5    121    1
6    103    1
6    107    1
6    121    1
6    103    0
6    140    0
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.