electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

how do I replace the reg to block ram?


Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> how do I replace the reg to block ram?
Author Message
kosen



Joined: 31 Aug 2007
Posts: 1


Post04 Sep 2007 10:16   

infer ram with initial contents


hi ,all
I have a verilog code to do the ST image process.
There are 800 ,4bit data reg for one color ,ex:reg signed [4:0] eramB[799:0]
Final I will creat three reg , but it will Synthesis fail because over the Slices and LUTs.
So I want to replace the REG to BRAM.
In fact, I also use the ISE to gen the BRAM(RAMB16_S18) code.But I don't how to instead it in my code and how could I know it work corret? @@

below is the my simple verilog about the reg and declare, the last is the ISE gen code .

------------------------------------------------------
module threshold ( Ycon,//y-aixs
Xcon, //x-axis
rin, //R
//---output
rout,

);
input [7:0] Rin;
input [10:0] ucon;
input [8:0] decon;
//--------------OUTPUT
output [3:0] rout ;
reg [3:0] rout ;
reg signed [9:0] rth;
//------------integer
integer i;
reg signed [4:0] eramB[799:0];
//------------error reg
reg signed[4:0] k;
wire [9:0] er1temp = (decon>1) ? (eramB[0]*5 + eramB[1]*1 ) :0 ;
wire [9:0] er3temp = (decon>1) ? (eramB[ucon-1]*3+ eramB[ucon]*5 + eramB[ucon+1]*1) : 0 ;
wire [9:0] er5temp = (decon>1) ? (eramB[798]*3 + eramB[799]*5 ) :0 ;
wire [9:0] er7temp = k*7 ;

....
....
.....
endmodule
RAMB16_S18 #(
.INIT(18'h00000), // Value of output RAM registers at startup
.SRVAL(18'h000000), // Ouput value upon SSR assertion
.WRITE_MODE("WRITE_FIRST"), // WRITE_FIRST, READ_FIRST or NO_CHANGE

// The following INIT_xx declarations specify the initial contents of the RAM
// Address 0 to 255
.INIT_00(256'h0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000),
.INIT_01(256'h0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000),

...
) RAMB16_S18_inst (
.DO(DO), // 16-bit Data Output
.DOP(DOP), // 2-bit parity Output
.ADDR(ADDR), // 10-bit Address Input
.CLK(CLK), // Clock
.DI(DI), // 16-bit Data Input
.DIP(DIP), // 2-bit parity Input
.EN(EN), // RAM Enable Input
.SSR(SSR), // Synchronous Set/Reset Input
.WE(WE) // Write Enable Input
);
Back to top
Google
AdSense
Google Adsense




Post04 Sep 2007 10:16   

Ads




Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 566


Post05 Sep 2007 5:31   

output register in block ram


XST can infer block RAM, but your example is missing many lines, so I can't compile it or guess what's wrong. Can you show us a complete example that can be compiled?

The XST User Guide chapter "HDL Coding Techniques" explains how write Verilog to infer block RAM without having to instantiate a RAMB16.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> how do I replace the reg to block ram?
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
functionality of the distributed RAM or block RAM in fpga? (3)
how to use block RAM (9)
what is the use of BLock RAM (3)
How to use block RAM in Spartan-3E? (5)
Difference between Block RAM and Distributed RAM in FPGA (16)
How to incorporate Block RAM in our code... (1)
How do I use Block RAM in my spartanII based design? (8)
Block RAM (3)
Spartan-3 Block RAM (5)
what is block RAM? (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS