Difference between revisions of "FPGA"

From CSLabsWiki
Jump to: navigation, search
(Added some usage info)
(Added test program)
 
Line 8: Line 8:
  
 
The LEDs are on 3 7 and 9, and the switch is on 144.
 
The LEDs are on 3 7 and 9, and the switch is on 144.
 +
 +
Here is a small test program that uses the button and LEDs.
 +
 +
erg.v:
 +
<pre>
 +
module erg( LED1, LED2, LED3, BUTT);
 +
 +
output LED1;
 +
output LED2;
 +
output LED3;
 +
input BUTT;
 +
 +
reg LED1;
 +
reg LED2;
 +
reg LED3;
 +
 +
wire BUTT;
 +
 +
always // ergergeg
 +
begin @ (BUTT)
 +
LED1=1'b0;
 +
LED2=1'b0;
 +
LED3=BUTT;
 +
end
 +
endmodule
 +
 +
</pre>
 +
 +
 +
Here is the csv file for the pin assignments to make the test program work.
 +
 +
deri_assignments.csv:
 +
<pre>
 +
# Copyright (C) 1991-2013 Altera Corporation
 +
# Your use of Altera Corporation's design tools, logic functions
 +
# and other software and tools, and its AMPP partner logic
 +
# functions, and any output files from any of the foregoing
 +
# (including device programming or simulation files), and any
 +
# associated documentation or information are expressly subject
 +
# to the terms and conditions of the Altera Program License
 +
# Subscription Agreement, Altera MegaCore Function License
 +
# Agreement, or other applicable license agreement, including,
 +
# without limitation, that your use is for the sole purpose of
 +
# programming logic devices manufactured by Altera and sold by
 +
# Altera or its authorized distributors.  Please refer to the
 +
# applicable agreement for further details.
 +
 +
# Quartus II 32-bit Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Web Edition
 +
# File: E:\deri_assignments.csv
 +
# Generated on: Sun Jan 31 00:40:22 2016
 +
 +
Status,From,To,Assignment Name,Value,Enabled,Entity,Comment,Tag
 +
Ok,,LED1,Location,PIN_3,Yes,,,
 +
Ok,,LED2,Location,PIN_7,Yes,,,
 +
Ok,,LED3,Location,PIN_9,Yes,,,
 +
Ok,,BUTT,Location,PIN_144,Yes,,,
 +
,<<new>>,<<new>>,<<new>>,,,,,
 +
 +
</pre>

Latest revision as of 20:50, 30 January 2016

COSI has an FPGA (field-programmable gate array). It's not a very impressive one, but it's something to get started with. It's a RioRand® EP2C5T144 Altera Cyclone II FPGA Mini Development Board. It cost us about $25 during the Spring 2015 semester.

Usage

So far we have not had much success using it under platforms other than Windows XP.

According to one Amazon review, it should be programmed with Quartus Version 11.0 Build 208 07/03/2011 SJ Web Edition, Service Pack 1.

The LEDs are on 3 7 and 9, and the switch is on 144.

Here is a small test program that uses the button and LEDs.

erg.v:

module erg( LED1, LED2, LED3, BUTT);

output LED1;
output LED2;
output LED3;
input BUTT;

reg LED1;
reg LED2;
reg LED3;

wire BUTT;

always // ergergeg
begin @ (BUTT)
LED1=1'b0;
LED2=1'b0;
LED3=BUTT;
end
endmodule


Here is the csv file for the pin assignments to make the test program work.

deri_assignments.csv:

# Copyright (C) 1991-2013 Altera Corporation
# Your use of Altera Corporation's design tools, logic functions 
# and other software and tools, and its AMPP partner logic 
# functions, and any output files from any of the foregoing 
# (including device programming or simulation files), and any 
# associated documentation or information are expressly subject 
# to the terms and conditions of the Altera Program License 
# Subscription Agreement, Altera MegaCore Function License 
# Agreement, or other applicable license agreement, including, 
# without limitation, that your use is for the sole purpose of 
# programming logic devices manufactured by Altera and sold by 
# Altera or its authorized distributors.  Please refer to the 
# applicable agreement for further details.

# Quartus II 32-bit Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Web Edition
# File: E:\deri_assignments.csv
# Generated on: Sun Jan 31 00:40:22 2016

Status,From,To,Assignment Name,Value,Enabled,Entity,Comment,Tag
Ok,,LED1,Location,PIN_3,Yes,,,
Ok,,LED2,Location,PIN_7,Yes,,,
Ok,,LED3,Location,PIN_9,Yes,,,
Ok,,BUTT,Location,PIN_144,Yes,,,
,<<new>>,<<new>>,<<new>>,,,,,