package jazz.circuit.blues;

///////////////////////////////////////////////////////////////////////////////
//
//                      Random-Access Memory for Blues
//
//     XXX: don't change the order of input and output fields (temporary)
//
///////////////////////////////////////////////////////////////////////////////

import jazz.circuit.*;

public extern device RAM {
  
  // Width of address bus
  public naddr: int;
  
  // Width of data bus
  public ndata: int;

  @ Device.setParams(format("naddr=%d ndata=%d", naddr, ndata));

  // Inputs
  public input read_addr: Net[naddr];
  public input write_addr: Net[naddr];
  public input write_enable: Net;
  public input data_in: Net[ndata];

  // Outputs
  public output data_out: Net[ndata];
}