Introduction to Basys 2. Switches Slide switchesPush button switches.

34
Introduction to Basys 2

Transcript of Introduction to Basys 2. Switches Slide switchesPush button switches.

Page 1: Introduction to Basys 2. Switches Slide switchesPush button switches.

Introduction to Basys 2

Page 2: Introduction to Basys 2. Switches Slide switchesPush button switches.

Switches

Slide switches Push button switches

Page 3: Introduction to Basys 2. Switches Slide switchesPush button switches.

Definition of Pin Number

File: basys2.ucf

Used during implementation stage

LED outputs

Slide switches

Pushbuttonswitches

The pin number of each

Page 4: Introduction to Basys 2. Switches Slide switchesPush button switches.

Software

• Adept Active HDL is used for writing Verilog code

• ISE/Webpack from Xilinx– Purpose: create a “bit” file from a Verilog file or

schematic based source files– The “bit” file is used to configure the basys2

board before it can perform any useful functions.

• Adept can be used to configure the FPGA with any suitable bit file stored on the computer

Page 5: Introduction to Basys 2. Switches Slide switchesPush button switches.

Start Aldec Active-HDL Student Edition

Page 6: Introduction to Basys 2. Switches Slide switchesPush button switches.

Start a New Workspace

Page 7: Introduction to Basys 2. Switches Slide switchesPush button switches.

New Design Wizard

Page 8: Introduction to Basys 2. Switches Slide switchesPush button switches.

Synthesis/Implementation PathsWe will use verilog in this class

Page 9: Introduction to Basys 2. Switches Slide switchesPush button switches.

Choose Default HDL Language to Verilog

Page 10: Introduction to Basys 2. Switches Slide switchesPush button switches.

Design Name

Page 11: Introduction to Basys 2. Switches Slide switchesPush button switches.

Set Paths for Integrated Tools

Page 12: Introduction to Basys 2. Switches Slide switchesPush button switches.

Design Entry

Page 13: Introduction to Basys 2. Switches Slide switchesPush button switches.

Verilog File

Page 14: Introduction to Basys 2. Switches Slide switchesPush button switches.

Keyword: module/endmodule

The keywords module and endmodule encapsulate the text that describes the module

Page 15: Introduction to Basys 2. Switches Slide switchesPush button switches.

Comments

• A pair of slashes– // comment– Forms a comment from the text that

follows it on the same line

• /* */– /* comment */

Page 16: Introduction to Basys 2. Switches Slide switchesPush button switches.

Direction of the Signals

The direction of the input and output signals is given byinput, outout or inout (for a bi-directional signal)

There are 6 outputs as an arrayZ[5:0]!

Page 17: Introduction to Basys 2. Switches Slide switchesPush button switches.

Schematic of Gates2

Page 18: Introduction to Basys 2. Switches Slide switchesPush button switches.

Concurrent StatementsTo describe the output each gate, we simply write the logicEquation for that gate preceded by the keyword assign.The concurrent statements are statements that can be written in any order.

Page 19: Introduction to Basys 2. Switches Slide switchesPush button switches.

wireYou can think of a wire as a wire in a circuit where actual voltages Could be measured.

Page 20: Introduction to Basys 2. Switches Slide switchesPush button switches.

Compile

Page 21: Introduction to Basys 2. Switches Slide switchesPush button switches.

Simulate gates2.v

Page 22: Introduction to Basys 2. Switches Slide switchesPush button switches.

Create a Top-Level Test Bench

You need to create a top-level test bench so you canuse physical switches/push buttons to stimulate the design

Page 23: Introduction to Basys 2. Switches Slide switchesPush button switches.

Top-Level Verilog Test Bench

Page 24: Introduction to Basys 2. Switches Slide switchesPush button switches.

Top-Level Synthesis Option

Input and output signals are assigned to pins on the FPGA during synthesis.

Page 25: Introduction to Basys 2. Switches Slide switchesPush button switches.

Synthesize

Page 26: Introduction to Basys 2. Switches Slide switchesPush button switches.

Error Message During Implementation Stage

Page 27: Introduction to Basys 2. Switches Slide switchesPush button switches.

Solution: incorrect Netlist

Page 28: Introduction to Basys 2. Switches Slide switchesPush button switches.

Implementation Completed with No Error

Page 29: Introduction to Basys 2. Switches Slide switchesPush button switches.

Adept Interface

Page 30: Introduction to Basys 2. Switches Slide switchesPush button switches.

Example 1

Page 31: Introduction to Basys 2. Switches Slide switchesPush button switches.

Example 2

Page 32: Introduction to Basys 2. Switches Slide switchesPush button switches.

Start Another Design

Page 33: Introduction to Basys 2. Switches Slide switchesPush button switches.

Use Push Buttons to control LED

Page 34: Introduction to Basys 2. Switches Slide switchesPush button switches.

Platform Flash

Adept can also program a bit file into an on-board non-volatile ROM called “Platform Flash”. Once programmed, the Platform Flash can automatically transfer a stored bit file to the FPGA at a subsequent power-on or reset event if the Mode Jumper (JP3) is set to ROM. The FPGA will remain configured until it is reset by a power-cycle event. ThePlatform Flash ROM will retain a bit file until it is reprogrammed, regardless of power-cycle events.