X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fip%2Fxilinx%2Fvc707mig%2Fvc707mig.scala;h=7b9ace36b64f1e170dfd86cb0c30ac5125c8a078;hb=refs%2Fheads%2Fu500vc7074GB;hp=0957d53badd4ce0ed550d9ac49adac26a1da5a4c;hpb=b83e9747282019746d1add650d07337b286719f6;p=sifive-blocks.git diff --git a/src/main/scala/ip/xilinx/vc707mig/vc707mig.scala b/src/main/scala/ip/xilinx/vc707mig/vc707mig.scala index 0957d53..7b9ace3 100644 --- a/src/main/scala/ip/xilinx/vc707mig/vc707mig.scala +++ b/src/main/scala/ip/xilinx/vc707mig/vc707mig.scala @@ -9,9 +9,9 @@ import freechips.rocketchip.config._ // IP VLNV: xilinx.com:customize_ip:vc707mig:1.0 // Black Box -class VC707MIGIODDR(depthGB : Integer) extends GenericParameterizedBundle(depthGB) { - require((depthGB==1) || (depthGB==4),"VC707MIGIODDR supports 1GB and 4GB depth configuraton only") - val ddr3_addr = Bits(OUTPUT,if(depthGB==1) 14 else 16) +class VC707MIGIODDR(depth : BigInt) extends GenericParameterizedBundle(depth) { + require((depth==0x40000000L) || (depth==0x100000000L),"VC707MIGIODDR supports 1GB and 4GB depth configuraton only") + val ddr3_addr = Bits(OUTPUT,if(depth==0x40000000L) 14 else 16) val ddr3_ba = Bits(OUTPUT,3) val ddr3_ras_n = Bool(OUTPUT) val ddr3_cas_n = Bool(OUTPUT) @@ -46,13 +46,15 @@ trait VC707MIGIOClocksReset extends Bundle { //scalastyle:off //turn off linter: blackbox name must match verilog module -class vc707mig(depthGB : Integer)(implicit val p:Parameters) extends BlackBox +class vc707mig(depth : BigInt)(implicit val p:Parameters) extends BlackBox { - require((depthGB==1) || (depthGB==4),"vc707mig supports 1GB and 4GB depth configuraton only") + private val oneGB : BigInt = 0x40000000L + private val fourGB : BigInt = 0x100000000L + require((depth==oneGB) || (depth==fourGB),"vc707mig supports 1GB and 4GB depth configuraton only") - override def desiredName = if(depthGB==4) "vc707mig4gb" else "vc707mig" + override def desiredName = if(depth==fourGB) "vc707mig4gb" else "vc707mig" - val io = new VC707MIGIODDR(depthGB) with VC707MIGIOClocksReset { + val io = new VC707MIGIODDR(depth) with VC707MIGIOClocksReset { // User interface signals val app_sr_req = Bool(INPUT) val app_ref_req = Bool(INPUT) @@ -63,7 +65,7 @@ class vc707mig(depthGB : Integer)(implicit val p:Parameters) extends BlackBox //axi_s //slave interface write address ports val s_axi_awid = Bits(INPUT,4) - val s_axi_awaddr = Bits(INPUT,if(depthGB==1) 30 else 32) + val s_axi_awaddr = Bits(INPUT,if(depth==oneGB) 30 else 32) val s_axi_awlen = Bits(INPUT,8) val s_axi_awsize = Bits(INPUT,3) val s_axi_awburst = Bits(INPUT,2) @@ -86,7 +88,7 @@ class vc707mig(depthGB : Integer)(implicit val p:Parameters) extends BlackBox val s_axi_bvalid = Bool(OUTPUT) //slave interface read address ports val s_axi_arid = Bits(INPUT,4) - val s_axi_araddr = Bits(INPUT,if(depthGB==1) 30 else 32) + val s_axi_araddr = Bits(INPUT,if(depth==oneGB) 30 else 32) val s_axi_arlen = Bits(INPUT,8) val s_axi_arsize = Bits(INPUT,3) val s_axi_arburst = Bits(INPUT,2)