- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-06-2009 02:21 PM
I'm getting the following error when I try to synthesize the code below using XST:
FATAL_ERROR:Xst:Portability/export/Port_Main.h:143
If I comment out the lines where the pDither arrays are accessed, then it compiles fine but that's probably due to the fact that it optimizes out the rams that I'm assuming it's having trouble infering. I changed the XST settings to do with infering rams but that didn't solve the issue, so now I'm completely lost.
I'm relatively new to verilog having been converted to it due solely to the fact that the schematic editor is so unbelievably buggy only to find that the verilog synthesis tools are equally buggy.
It seems that I spend more time fighting with the xilinx tools than actually working.
module vga_dither_spatial(iClk, iRed, iGreen, iBlue, iDither, iHSync, iVSync, oRed, oGreen, oBlue, oHSync, oVSync);
input iClk;
input [7:0] iRed;
input [7:0] iGreen;
input [7:0] iBlue;
input [3:0] iDither;
input iHSync;
input iVSync;
output [4:0] oRed;
output [4:0] oGreen;
output [3:0] oBlue;
output oHSync;
output oVSync;
reg [4:0] oRed;
reg [4:0] oGreen;
reg [3:0] oBlue;
reg oHSync;
reg oVSync;
reg pDitherRed[63:0];
reg pDitherGreen[63:0];
reg pDitherBlue[255:0];
initial begin
$readmemb("c:/verilog/vga_dither_spatial_red.bin", pDitherRed);
$readmemb("c:/verilog/vga_dither_spatial_green.bin
$readmemb("c:/verilog/vga_dither_spatial_blue.bin"
end
always @ (posedge iClk) begin
oRed <= iRed[7:3] + pDitherRed[{iRed[2:0], iDither[2:0]}];
oGreen <= iGreen[7:3] + pDitherGreen[{iGreen[2:0], iDither[2:0]}];
oBlue <= iBlue[7:4] + pDitherBlue[{iBlue[3:0], iDither[3:0]}];
oHSync <= iHSync;
oVSync <= iVSync;
end
endmodule
Solved! Go to Solution.
Re: Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-06-2009 04:47 PM
So for anyone else who comes across this problem you simply have to make the memory more than 1 bit wide for it to compile.
Re: Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-07-2009 04:17 AM
I'm not entirely sure if this is what you meant in your solution post, so I'll mention it here to be clear. What you probably meant was reg [255:0] pDitherBlue;, not reg pDitherBlue[255:0];. The reason is that you're not inferring a memory proper, but what you actually want to infer is a 256-input multiplexer with a 256-bit register loaded on the input lines.
That said, I agree that it is quite silly that you got the error that you did, and probably XST should have been able to synthesize it... but in terms of style, you really wanted a mux there, not a memory.
Re: Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-07-2009 07:05 AM
It seems to me that it makes more sense to define the bus width as the width of the data accesses you perform rather than using a larger bus and putting a multiplexer on it which does the same thing but is a less abstract way of thinking about it.
Re: Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-10-2009 09:16 AM
hi , vasanth here ... i too faced the same fatal error .... i dono how to apply the solution that has worked for u .... here is my code .... kindly help me ...
thanks a lot ...
`timescale 1ns / 1ps
//////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:12:16 04/10/2009
// Design Name:
// Module Name: source
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////
module cam (wl,bl,blo,sl,clk,rd,out,srch);
//Parameter Declaration
parameter wrd_len = 4;
parameter mem_siz = 16;
//Port Declaration
input [wrd_len-1:0]wl,sl;
input clk,rd;
input [wrd_len-1:0]bl;
// inout [mem_siz-1:0]ml;
output [wrd_len-1:0]blo,out;
output [31:0]srch;
integer i;
//Data Type Declaration
reg [wrd_len-1:0]blo,out;
reg [31:0]srch;
// reg [mem_siz-1:0]ml;
//Local Variable Declaration
reg [wrd_len-1:0]mem[0:mem_siz-1];
reg cont = 1;
initial begin
$printtimescale;
end
//Code Starts here
always @ (posedge clk) begin
if(wl !== 4'bzzzz) begin
if (rd == 0) begin //wirte
i = wl;
mem[i] = bl;
end
if (rd == 1) begin //read
i = wl;
blo = mem[i];
end
end
else begin //search
cont = 1;
srch = 0;
for (i = 0; i<mem_siz ; i = i + 1) begin
if (cont) begin
out = 4'bxxxx;
srch = srch + 1;
if (mem[i] == sl) begin
out = i;
cont = 0;
end
end
end
end
end
endmodule
Re: Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-12-2009 04:51 PM
Also it's hard to debug code that's is so heavily abbreviated without comments, so the likelyhood of anyone correcting the error for you is very low.
If I were doing content addressable memory then I'd make a single memory cell and comparator, then hierarchically instantiate it.
Re: Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-12-2009 09:27 PM
Re: Fatal error concerning bit array access
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-19-2009 12:26 PM











