FPGA開発日記

カテゴリ別記事インデックス https://msyksphinz.github.io/github_pages , English Version https://fpgadevdiary.hatenadiary.com/

オープンソース・アウトオブオーダCPU NaxRiscvを概観する (8. オプションで生成されるVerilogデザインを制御できるか?)

msyksphinz.hatenablog.com

msyksphinz.hatenablog.com

msyksphinz.hatenablog.com

msyksphinz.hatenablog.com

msyksphinz.hatenablog.com

msyksphinz.hatenablog.com

msyksphinz.hatenablog.com

msyksphinz.hatenablog.com

もうちょっとまともに読めるSystemVerilogは出力できないものかと、Spinal-HDLのオプションを見てみる。

  • SpinalHDL/core/src/main/scala/spinal/core/Spinal.scala
/**
 * Spinal configuration for the generation of the RTL 
 */
case class SpinalConfig(mode                           : SpinalMode = null,
                        flags                          : mutable.HashSet[Any] = mutable.HashSet[Any](),
                        debugComponents                : mutable.HashSet[Class[_]] = mutable.HashSet[Class[_]](),
                        keepAll                        : Boolean = false,
                        defaultConfigForClockDomains   : ClockDomainConfig = ClockDomainConfig(),
                        onlyStdLogicVectorAtTopLevelIo : Boolean = false,
                        defaultClockDomainFrequency    : IClockDomainFrequency = UnknownFrequency(),
                        targetDirectory                : String = SpinalConfig.defaultTargetDirectory,
                        oneFilePerComponent            : Boolean = false,
                        netlistFileName                : String = null,
                        dumpWave                       : DumpWaveConfig = null,
                        globalPrefix                   : String = "",
                        var privateNamespace           : Boolean = false,
                        var formalAsserts              : Boolean = false,
                        anonymSignalPrefix             : String = null,
                        device                         : Device = Device(),
                        inlineRom                      : Boolean = false,
                        romReuse                       : Boolean = false,
                        genVhdlPkg                     : Boolean = true,
                        verbose                        : Boolean = false,
                        mergeAsyncProcess              : Boolean = false,
                        asyncResetCombSensitivity      : Boolean = false,
                        anonymSignalUniqueness         : Boolean = false,
                        inlineConditionalExpression    : Boolean = false,
                        nameWhenByFile                 : Boolean = true,
                        var genLineComments            : Boolean = false,
                        noRandBoot                     : Boolean = false,
                        randBootFixValue               : Boolean = true,
                        noAssert                       : Boolean = false,
                        fixToWithWrap                  : Boolean = true,
                        headerWithDate                 : Boolean = false,
                        headerWithRepoHash             : Boolean = true,
                        removePruned                   : Boolean = false,
                        allowOutOfRangeLiterals        : Boolean = false,
                        dontCareGenAsZero              : Boolean = false,
                        phasesInserters                : ArrayBuffer[(ArrayBuffer[Phase]) => Unit] = ArrayBuffer[(ArrayBuffer[Phase]) => Unit](),
                        transformationPhases           : ArrayBuffer[Phase] = ArrayBuffer[Phase](),
                        memBlackBoxers                 : ArrayBuffer[Phase] = ArrayBuffer[Phase] (/*new PhaseMemBlackBoxerDefault(blackboxNothing)*/),
                        rtlHeader                      : String = null,
                        scopeProperties                : mutable.LinkedHashMap[ScopeProperty[_], Any] = mutable.LinkedHashMap[ScopeProperty[_], Any](),
                        private [core] var _withEnumString : Boolean = true,
                        var enumPrefixEnable           : Boolean = true,
                        var enumGlobalEnable           : Boolean = false,
                        bitVectorWidthMax              : Int = 4096,
                        var singleTopLevel             : Boolean = true

例えば、oneFilePerComponentを追加しても、NaxRiscvの場合は何も変わらない。

  • NaxRiscv/src/main/scala/naxriscv/Gen.scala
    val spinalConfig = SpinalConfig(inlineRom = true, anonymSignalPrefix = "_zz", oneFilePerComponent = true)

keepAll=trueを追加してみた。これでも何も変わらない。