Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me !! saving received data >>> Sram (verilog)?

Status
Not open for further replies.

Bebo

Newbie level 4
Joined
Nov 17, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
UAE
Activity points
1,404
Hi..

I am a beginner in verilog and i have a problem in my code i don't know how to solve the problem ..

My program is to received a data from my PC using RS232 and save it on the Sram on DE2 board:

This code combined two modules (received data and memory):

############################################
module serialfun(clk, RxD, RxD_data, WE,nWR,nCE,
nRD,Address_In,Address, Data_Bus,LED);
input clk;
input RxD;
//output RxD_idle;
//output RxD_endofpacket;
//output RxD_data_ready;
output nRD;
output nWR, nCE;
input WE;
input [3:0] Address_In;
output [17:0] Address;
inout [7:0] Data_Bus;
output [7:0] LED;


///////////////////////////////////////////////////
//wire RxD_data_ready;
output [7:0] RxD_data;
async_receiver deserializer(.clk(clk), .RxD(RxD), .RxD_data(RxD_data) );
///////////////////////////////////////////////////
//
wire Data_In = RxD_data;

MEM_SRAM u0(.Data_Bus(Data_Bus), .Address(Address), .nRD(nRD),
.nWR(nWR), .nCE(nCE), .Address_In(Address_In), .Data_In(Data_In),.LED(LED),.WE(WE));
endmodule
#################################


This code for the memory:

###################################
module MEM_SRAM (
Data_Bus, // Data Bus
Address, // RAM Address
nRD, // RAM Read Enable
nWR, // RAM Write Enable
nCE, // RAM Chip Enable
nUB, // RAM Upper Byte
nLB, // RAM Lower Byte
Address_In, // Switches
Data_In,
LED,
WE); // Write Enable
//output test;
output [17:0] Address; // RAM Signals
inout [7:0] Data_Bus;
output nRD, nWR;
output nUB, nLB;
output nCE;
input WE; // Write Enable
input [3:0] Address_In;
input [7:0] Data_In;
output [7:0] LED;


assign nUB = 1'b1; // Disable Upper Byte
assign nLB = 1'b0; // Enable Lower Byte
assign nCE = 1'b0; // Enable Chip
assign nRD = 1'b0; // Read Enable
assign nWR = !WE; // Write Enable
assign Address[17:4] = 13'h0000;
assign Address[3:0] = Address_In;

assign Data_Bus = WE? Data_In : 8'hzz;
assign LED = Data_Bus; // Data will appear on LED

endmodule
##########################################

I test the memory code with input data and save it and its work, but when i tried to save the received data (wire Data_In = RxD_data ) and display the data on LED it doesn't work

I don't have any problem in receiving the data (RxD_data)),


PlZ help me :(
 

Re: Help me !! saving received data >>> Sram (veril

Problem in port mapping of the SRAM instantiation.

MEM_SRAM u0(.Data_Bus(Data_Bus), .Address(Address), .nRD(nRD),
.nWR(nWR), .nCE(nCE), .Address_In(Address_In), .Data_In(Data_In),.LED(LED),.WE(WE));

data_in should be mapped to RxD_data or wire Data_In, i.e.
.Data_In(RxD_data)

similarly check for all port of SRAM instantiation.

- Keshav
 

Re: Help me !! saving received data >>> Sram (veril

Thank you very much :) ...

its work now ...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top