From 4e7152ae5accd0555c81be0b38caddb443e4734a Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Mon, 14 May 2018 20:18:53 +0200 Subject: [PATCH] IcestormFlow add ultraplus support --- .../lib/eda/icestorm/IcestormFlow.scala | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/main/scala/spinal/lib/eda/icestorm/IcestormFlow.scala b/src/main/scala/spinal/lib/eda/icestorm/IcestormFlow.scala index 4f7496a..08f0821 100644 --- a/src/main/scala/spinal/lib/eda/icestorm/IcestormFlow.scala +++ b/src/main/scala/spinal/lib/eda/icestorm/IcestormFlow.scala @@ -50,7 +50,7 @@ object IcestormFlow { workspacePathFile.mkdir() FileUtils.copyFileToDirectory(new File(toplevelPath), workspacePathFile) doCmd(List("yosys", "-v3", "-p", s"synth_ice40 -top $projectName -blif ${projectName}.blif", s"$projectName.v" ), workspacePath) - val arachne = doCmd(List("arachne-pnr", "-d", device.replace("hx",""), "--max-passes", "600", "-P", pack, s"$projectName.blif" ,"-o", s"$projectName.asc"), workspacePath) + val arachne = doCmd(List("arachne-pnr", "-d", device.replace("hx","").replace("up",""), "--max-passes", "600", "-P", pack, s"$projectName.blif" ,"-o", s"$projectName.asc"), workspacePath) doCmd(List("icepack", s"$projectName.asc", s"$projectName.bin"), workspacePath) val icetime = doCmd(List("icetime", "-tmd", device, s"${projectName}.asc"), workspacePath) new Report{ @@ -138,13 +138,24 @@ object IcestormFlow { } def main(args: Array[String]) { +// SpinalVerilog(StreamFifo(Bits(8 bits), 64)) +// val report = IcestormFlow( +// workspacePath="/home/spinalvm/tmp", +// toplevelPath="StreamFifo.v", +// family="iCE40", +// device="hx8k", +// pack = "ct256" +// ) +// println(report.getArea()) +// println(report.getFMax()) +// } SpinalVerilog(StreamFifo(Bits(8 bits), 64)) val report = IcestormFlow( workspacePath="/home/spinalvm/tmp", - toplevelPath="VexRiscv.v", + toplevelPath="StreamFifo.v", family="iCE40", - device="hx8k", - pack = "ct256" + device="up5k", + pack = "sg48" ) println(report.getArea()) println(report.getFMax()) @@ -166,6 +177,19 @@ object IcestormStdTargets { ) } } + + targets += new Target { + override def getFamilyName(): String = "iCE40Ultra" + override def synthesise(rtl: Rtl, workspace: String): Report = { + IcestormFlow( + workspacePath=workspace, + toplevelPath=rtl.getRtlPath(), + family=getFamilyName(), + device="up5k", + pack = "sg48" + ) + } + } targets } } \ No newline at end of file