Bebo
Newbie level 4
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
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