+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Full Member level 1
    Points: 1,503, Level: 8

    Join Date
    Jun 2011
    Posts
    101
    Helped
    0 / 0
    Points
    1,503
    Level
    8

    synchronization or Asynchrony reading and writing SDRAM?

    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!

    •   Alt6th June 2017, 03:13

      advertising

        
       

  2. #2
    Super Moderator
    Points: 26,240, Level: 39
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    5,956
    Helped
    1462 / 1462
    Points
    26,240
    Level
    39

    Re: synchronization or Asynchrony reading and writing SDRAM?

    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.



--[[ ]]--