Jun 6, 2017 #1 H happsky Advanced Member level 4 Joined Jun 6, 2011 Messages 101 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,296 Activity points 1,932 Code: module WR_RD_DSP16_clk(clk, DSP_ECLKOUT, DSP_ED, nWR, nRD, data ); input clk;//不同时钟域的clk input DSP_ECLKOUT; inout [15:0] DSP_ED; input nWR; input nRD; output [15:0] data;reg [15:0] data; reg [15:0] dsp_data; always @(posedge DSP_ECLKOUT) if(~nWR) dsp_data[15:0]<=DSP_ED[15:0]; else dsp_data[15:0]<=dsp_data[15:0]; assign DSP_ED[15:0]=(nRD) ? 16'hzzzz:dsp_data[15:0]; always @(posedge clk) data[15:0]<=dsp_data[15:0]; endmodule where nWR and nRD is: Code: nWR =~(~DSP_CE& ~DSP_AWE& (DSP_EA[21:2]==20'h00000)); nRD =~(~DSP_CE& ~DSP_ARE&~DSP_AOE&(DSP_EA[21:2]==20'h00000)); Dear all: This is a code read and write SDRAM,but I don't know it is synchronization or asynchrony,I think SDRAM must be synchronization ,but it's seem be asynchrony from the code. And what the function of this sentence: Code: assign DSP_ED[15:0]=(nRD) ? 16'hzzzz:dsp_data[15:0]; Thank you very much!:razz:
Code: module WR_RD_DSP16_clk(clk, DSP_ECLKOUT, DSP_ED, nWR, nRD, data ); input clk;//不同时钟域的clk input DSP_ECLKOUT; inout [15:0] DSP_ED; input nWR; input nRD; output [15:0] data;reg [15:0] data; reg [15:0] dsp_data; always @(posedge DSP_ECLKOUT) if(~nWR) dsp_data[15:0]<=DSP_ED[15:0]; else dsp_data[15:0]<=dsp_data[15:0]; assign DSP_ED[15:0]=(nRD) ? 16'hzzzz:dsp_data[15:0]; always @(posedge clk) data[15:0]<=dsp_data[15:0]; endmodule where nWR and nRD is: Code: nWR =~(~DSP_CE& ~DSP_AWE& (DSP_EA[21:2]==20'h00000)); nRD =~(~DSP_CE& ~DSP_ARE&~DSP_AOE&(DSP_EA[21:2]==20'h00000)); Dear all: This is a code read and write SDRAM,but I don't know it is synchronization or asynchrony,I think SDRAM must be synchronization ,but it's seem be asynchrony from the code. And what the function of this sentence: Code: assign DSP_ED[15:0]=(nRD) ? 16'hzzzz:dsp_data[15:0]; Thank you very much!:razz:
Jun 6, 2017 #2 ads-ee Super Moderator Staff member Joined Sep 10, 2013 Messages 7,944 Helped 1,822 Reputation 3,654 Reaction score 1,808 Trophy points 1,393 Location USA Activity points 60,207 This says it's syncrhonous Code: always @(posedge DSP_ECLKOUT) the nWR and nRD are produced combinationally but are used synchronous to the clock. the assign is saying output High-Z on the output pins when reading data from the SDRAM. DSP_ED is an inout.
This says it's syncrhonous Code: always @(posedge DSP_ECLKOUT) the nWR and nRD are produced combinationally but are used synchronous to the clock. the assign is saying output High-Z on the output pins when reading data from the SDRAM. DSP_ED is an inout.