Fix compatibility with OSS-CAD-SUITE
Rework the way the Yosys slang plugin is loaded in `build.mill`. The environment variable `YOSYS_SLANG_SO` is now accessed with `sys.env.get` to avoid a hard failure when it is not set. If the variable is present, `-m $YOSYS_SLANG_SO` is passed to Yosys; otherwise the plugin is loaded via `plugin -i slang`.
This commit is contained in:
parent
7e0a878e6c
commit
4e01d48e7f
11
build.mill
11
build.mill
@ -107,11 +107,16 @@ trait GowinFlow extends Flow {
|
|||||||
case _ => ""
|
case _ => ""
|
||||||
}
|
}
|
||||||
|
|
||||||
val yosysSlangPlugin = sys.env("YOSYS_SLANG_SO")
|
val yosysSlangPluginSo = sys.env.get("YOSYS_SLANG_SO")
|
||||||
|
|
||||||
|
val (pluginArg, pluginCmd) = yosysSlangPluginSo match {
|
||||||
|
case Some(soName) => (Seq("-m", soName), "")
|
||||||
|
case _ => (Seq(), "plugin -i slang;")
|
||||||
|
}
|
||||||
|
|
||||||
os.call((
|
os.call((
|
||||||
"yosys", "-m", yosysSlangPlugin, "-l", s"$out/yosys.log", "-p",
|
"yosys", pluginArg, "-l", s"$out/yosys.log", "-p",
|
||||||
s"read_slang $genSrc $stSrc; synth_gowin $topCmd -nowidelut -json $synthJson"
|
s"$pluginCmd read_slang $genSrc $stSrc; synth_gowin $topCmd -nowidelut -json $synthJson"
|
||||||
))
|
))
|
||||||
|
|
||||||
PathRef(synthJson)
|
PathRef(synthJson)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user