aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@trantor.hos.anvin.org>2010-09-18 17:40:14 -0700
committerH. Peter Anvin <hpa@trantor.hos.anvin.org>2010-09-18 17:40:14 -0700
commita378cfc8700a22c4be05a44b4e110241760318e9 (patch)
treea1f2fa88228c0dbbb5d396be9a1334c07aaafcb6
parent029479d9d8b95452220794d500e94b1e4c873ca6 (diff)
downloadabc80-a378cfc8700a22c4be05a44b4e110241760318e9.tar.gz
abc80-a378cfc8700a22c4be05a44b4e110241760318e9.tar.xz
abc80-a378cfc8700a22c4be05a44b4e110241760318e9.zip
"Flatten" the FGCTL color ROM
Flatten the FGCTL color ROM; just input the color select on A[1:0] and the FGCTL selection on A[8:2]...
-rwxr-xr-xdata/fgcol.pl9
-rw-r--r--mega/fgcolrom.v36
2 files changed, 22 insertions, 23 deletions
diff --git a/data/fgcol.pl b/data/fgcol.pl
index b67656f..4d8df63 100755
--- a/data/fgcol.pl
+++ b/data/fgcol.pl
@@ -23,20 +23,19 @@
%colenc = ('K' => 0, 'B' => 1, 'G' => 2, 'C' => 3,
'R' => 4, 'M' => 5, 'Y' => 6, 'W' => 7);
-print "DEPTH = 128;\n";
-print "WIDTH = 12;\n";
+print "DEPTH = 512;\n";
+print "WIDTH = 3;\n";
print "ADDRESS_RADIX = HEX;\n";
print "DATA_RADIX = HEX;\n";
print "CONTENT\n";
print "BEGIN\n";
+$a = 0;
for ($i = 0; $i < 128; $i++) {
- $n = 0;
for ($x = 0; $x < 4; $x++) {
$c = substr($coltbl[$i], $x, 1);
$c = $colenc{$c};
- $n |= $c << (3*$x);
+ printf "%02X : %01X\n", $a++, $c;
}
- printf "%02X : %03X\n", $i, $n;
}
print "END;\n";
diff --git a/mega/fgcolrom.v b/mega/fgcolrom.v
index aff9908..d89270b 100644
--- a/mega/fgcolrom.v
+++ b/mega/fgcolrom.v
@@ -41,9 +41,9 @@ module fgcolrom (
clock,
q);
- input [6:0] address;
+ input [8:0] address;
input clock;
- output [11:0] q;
+ output [2:0] q;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_off
`endif
@@ -52,8 +52,8 @@ module fgcolrom (
// synopsys translate_on
`endif
- wire [11:0] sub_wire0;
- wire [11:0] q = sub_wire0[11:0];
+ wire [2:0] sub_wire0;
+ wire [2:0] q = sub_wire0[2:0];
altsyncram altsyncram_component (
.clock0 (clock),
@@ -71,7 +71,7 @@ module fgcolrom (
.clocken1 (1'b1),
.clocken2 (1'b1),
.clocken3 (1'b1),
- .data_a ({12{1'b1}}),
+ .data_a ({3{1'b1}}),
.data_b (1'b1),
.eccstatus (),
.q_b (),
@@ -86,12 +86,12 @@ module fgcolrom (
altsyncram_component.intended_device_family = "Cyclone II",
altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=NO",
altsyncram_component.lpm_type = "altsyncram",
- altsyncram_component.numwords_a = 128,
+ altsyncram_component.numwords_a = 512,
altsyncram_component.operation_mode = "ROM",
altsyncram_component.outdata_aclr_a = "NONE",
altsyncram_component.outdata_reg_a = "UNREGISTERED",
- altsyncram_component.widthad_a = 7,
- altsyncram_component.width_a = 12,
+ altsyncram_component.widthad_a = 9,
+ altsyncram_component.width_a = 3,
altsyncram_component.width_byteena_a = 1;
@@ -118,15 +118,15 @@ endmodule
// Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
// Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
// Retrieval info: PRIVATE: MIFfilename STRING "data/fgcol.mif"
-// Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "128"
+// Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "512"
// Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
// Retrieval info: PRIVATE: RegAddr NUMERIC "1"
// Retrieval info: PRIVATE: RegOutput NUMERIC "0"
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
// Retrieval info: PRIVATE: SingleClock NUMERIC "1"
// Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
-// Retrieval info: PRIVATE: WidthAddr NUMERIC "7"
-// Retrieval info: PRIVATE: WidthData NUMERIC "12"
+// Retrieval info: PRIVATE: WidthAddr NUMERIC "9"
+// Retrieval info: PRIVATE: WidthData NUMERIC "3"
// Retrieval info: PRIVATE: rden NUMERIC "0"
// Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
// Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
@@ -134,18 +134,18 @@ endmodule
// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
// Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
// Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
-// Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "128"
+// Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "512"
// Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
// Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
// Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
-// Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "7"
-// Retrieval info: CONSTANT: WIDTH_A NUMERIC "12"
+// Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "9"
+// Retrieval info: CONSTANT: WIDTH_A NUMERIC "3"
// Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
-// Retrieval info: USED_PORT: address 0 0 7 0 INPUT NODEFVAL address[6..0]
+// Retrieval info: USED_PORT: address 0 0 9 0 INPUT NODEFVAL address[8..0]
// Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC clock
-// Retrieval info: USED_PORT: q 0 0 12 0 OUTPUT NODEFVAL q[11..0]
-// Retrieval info: CONNECT: @address_a 0 0 7 0 address 0 0 7 0
-// Retrieval info: CONNECT: q 0 0 12 0 @q_a 0 0 12 0
+// Retrieval info: USED_PORT: q 0 0 3 0 OUTPUT NODEFVAL q[2..0]
+// Retrieval info: CONNECT: @address_a 0 0 9 0 address 0 0 9 0
+// Retrieval info: CONNECT: q 0 0 3 0 @q_a 0 0 3 0
// Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom.v TRUE