Example: confidence

Intro to Verilog - MIT

Wires Theory vs Reality - Lab 1. Intro to Verilog 30-50mv voltage drop in chip Wires theory vs reality (Lab1) Wires have inductance and resistance Hardware Description Languages power Verilog supply -- structural: modules, instances noise . -- dataflow : continuous assignment .. noise during transitions -- sequential behavior: always blocks -- pitfalls Voltage drop across wires -- other useful features LC ringing after transitions Reminder: Lab #1 due by 9pm tonight Fall 2017 Lecture 3 1 Fall 2017 Lecture 3 2. Bypass (Decoupling) Capacitors The Need for HDLs Electrolytic Bypass capacitor A specification is an engineering contract that lists all the goals Capacitor 10uf typical for a project: Provides additional filtering from main goals include area, power, throughput, latency, functionality, test power supply coverage, costs (NREs and piece costs), Helps you figure out Used as local energy when you're done and how to make engineering tradeoffs.

chooses what architecture is used for a given instance of an entity. Design is composed of modules. Behavioral, dataflow and structural modeling. Synthesizable subset... Behavioral, dataflow and structural modeling. Synthesizable subset... Harder to learn and use, not technology-specific, DoD mandate Easy to learn and use, fast

Tags:

  Architecture, Dataflow

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Intro to Verilog - MIT

1 Wires Theory vs Reality - Lab 1. Intro to Verilog 30-50mv voltage drop in chip Wires theory vs reality (Lab1) Wires have inductance and resistance Hardware Description Languages power Verilog supply -- structural: modules, instances noise . -- dataflow : continuous assignment .. noise during transitions -- sequential behavior: always blocks -- pitfalls Voltage drop across wires -- other useful features LC ringing after transitions Reminder: Lab #1 due by 9pm tonight Fall 2017 Lecture 3 1 Fall 2017 Lecture 3 2. Bypass (Decoupling) Capacitors The Need for HDLs Electrolytic Bypass capacitor A specification is an engineering contract that lists all the goals Capacitor 10uf typical for a project: Provides additional filtering from main goals include area, power, throughput, latency, functionality, test power supply coverage, costs (NREs and piece costs), Helps you figure out Used as local energy when you're done and how to make engineering tradeoffs.

2 Later source provides peak current during on, goals help remind everyone (especially management) what was transitions agreed to at the outset! Provided decoupling of noise spikes during transitions top-down design: partition the project into modules with well- Placed as close to the IC defined interfaces so that each module can be worked on by a as possible. separate team. Gives the SW types a head start too! Use small capacitors for high frequency response. (Hardware/software codesign is currently all the rage ). Use large capacitors to Example a well defined Instruction Set architecture (ISA). localize bulk energy storage can last for generations . Through hole PCB (ancient) shown for clarity.

3 Fall 2017 Lecture 3 3 Fall 2017 Lecture 3 4. The Need for HDLs (cont'd.) Using an HDL description So, we have an executable functional specification that A behavioral model serves as an executable functional documents exact behavior of all the modules and their specification that documents the exact behavior of all the interfaces individual modules and their interfaces. Since one can run can be tested & refined until it does what we want tests, this model can be refined and finally verified through simulation. An HDL description is the first step in a mostly automated process to build an implementation directly from the behavioral model We need a way to talk about what hardware should do without actually designing the hardware itself, , we need to separate behavior from implementation.

4 We need a HDL Gate CPLD. Logic Synthesis netlist Place & route FPGA. description Hardware Description Language HDL logic create floor plan blocks Stdcell ASIC. map to target library (LUTs) place cells in block optimize speed, area route interconnect If we were then able to synthesize an implementation directly optimize (iterate!). from the behavioral model, we'd be in good shape! Functional design Physical design Fall 2017 Lecture 3 5 Fall 2017 Lecture 3 6. A Tale of Two HDLs Universal Constraint File - UCF. VHDL Verilog Text file containing the mapping from a device independent HDL. ADA-like verbose syntax, lots of C-like concise syntax circuit net to the physical I/O pin.

5 This allows Verilog (HDL) to redundancy (which can be good!) be device independent. Extensible types and simulation Built-in types and logic net "ram0_data<35>" loc="ab25" | fast | iostandard=lvdci_33 | drive=12;. engine. Logic representations are representations. Oddly, this led not built in and have evolved with to slightly incompatible simulators Assigns bit 35 of the signal ram0_data to pin ab25 on the IC. time (IEEE-1164). from different vendors. Specifies the i/o driver configured for fast slew rate with LVTTL level Design is composed of entities Design is composed of modules. Specifies drive strength of 12mA. each of which can have multiple architectures. A configuration chooses what architecture is Constraints may also include timing constraints.

6 Used for a given instance of an Don't worry all constraints for the labkit have been defined entity. Behavioral, dataflow and Behavioral, dataflow and structural modeling. structural modeling. For Vivado, xdc file are used (Xilinx Design Constraint). {PACKAGE_PIN H17 IOSTANDARD LVCMOS33 } [get_ports { LED[0] }];. Synthesizable Synthesizable LED[0] is CMOS being driven by IC Package H pin 17. Harder to learn and use, not Easy to learn and use, fast technology-specific, DoD mandate simulation, good for hardware design Fall 2017 Lecture 3 7 Fall 2017 Lecture 3 8. Verilog data values Numeric Constants Since we're describing hardware, we'll need to represent the Constant values can be specified with a specific width and radix: values that can appear on wires.

7 Verilog uses a 4-valued logic: 123 // default: decimal radix, unspecified width d123 // d = decimal radix Value Meaning h7B // h = hex radix 0 Logic zero, low o173 // o = octal radix b111_1011 // b = binary radix, _ are ignored 1 Logic one, high hxx // can include X, Z or ? in non-decimal constants Z or ? High impedance (tri-state buses) 16'd5 // 16-bit constant b0000_0000_0000_0101. 11'h1X? // 11-bit constant b001_XXXX_ZZZZ. X Unknown value (simulation). By default constants are unsigned and will be extended with 0's X is used by simulators when a wire hasn't been initialized to a on left if need be (if high-order bit is X or Z, the extended bits known value or when the predicted value is an illegitimate logic will be X or Z too).

8 You can specify a signed constant as follows: value ( , due to contention on a tri-state bus). 8'shFF // 8-bit twos-complement representation of -1. Verilog also has the notion of drive strength but we can safely To be absolutely clear in your intent it's usually best to explicitly ignore this feature for our purposes. specify the width and radix. Fall 2017 Lecture 3 9 Fall 2017 Lecture 3 10. Wires General tips for less bugs We have to provide declarations* for all our named wires (aka nets ). We can create buses indexed collections of wires by Add `default_nettype none at the top of your source specifying the allowable range of indices in the declaration: prevents ISE/Vivado from inferring wires from module wire a,b,z; // three 1-bit wires instantiations and forces you to explicitly declare wires and regs wire [31:0] memdata; // a 32-bit bus (and their widths) before using them [May need to comment out wire [7:0] b1,b2,b3,b4; // four 8-bit buses for Modelsim.]

9 ]. wire [W-1:0] input; // parameterized bus Read synthesis warnings. Most can be can be ignored but a few Note that [0:7] and [7:0] are both legitimate but it pays to are important: port width mismatches, unused wires, naming develop a convention and stick with it. Common usage is errors, etc [MSB:LSB] where MSB > LSB; usually LSB is 0. Note that we can use an expression in our index declaration but the expression's value must be able to be determined at compile time. We can also Common errors: build unnamed buses via concatenation: Multiple sources Unmatch constraints {b1,b2,b3,b4} // 32-bit bus, b1 is [31:24], b2 is [23:16], . {4{b1[3:0]},16'h0000} // 32-bit bus, 4 copies of b1[3:0], 16 0's * Actually by default undeclared identifiers refer to a 1-bit wire, but this means typos get you into trouble.

10 Specify `default_nettype none at the top of your source files to avoid this bogus behavior. Fall 2017 Lecture 3 11 Fall 2017 Lecture 1 12. Basic building block: modules Continuous assignments In Verilog we design modules, one of which will be identified as If we want to specify a behavior equivalent to combinational logic, our top-level module. Modules usually have named, directional use Verilog 's operators and continuous assignment statements: ports (specified as input, output or inout) which are used to communicate with the module. Don't forget this ; // 2-to-1 multiplexer with dual-polarity outputs module mux2(input a,b,sel, output z,zbar);. // 2-to-1 multiplexer with dual-polarity outputs // again order doesn't matter (concurrent execution!)


Related search queries