t-crest / patmos

Patmos is a time-predictable VLIW processor, and the processor for the T-CREST project
http://patmos.compute.dtu.dk
BSD 2-Clause "Simplified" License
135 stars 72 forks source link

Patmos emulator fails to build with direct-mapped instruction cache #109

Open michael-platzer opened 2 years ago

michael-platzer commented 2 years ago

Patmos emulator fails to build when the method cache is replaced by a direct-mapped instruction cache in hardware/config/default.xml:

-  <ICache type="method" size="8k" assoc="16" repl="fifo" />
+  <ICache type="line" size="8k" assoc="1" repl="dm" />

Several exceptions are raised during the build process:

Patmos configuration "default configuration for DE2-115 board"
    Frequency: 80 MHz
    Pipelines: 2
    Cores: 1
    Instruction cache: 8 KB, direct-mapped
    Data cache: 4 KB, direct-mapped, write through
    Stack cache: 2 KB
    Instruction SPM: 1 KB
    Data SPM: 2 KB
    Addressable external memory: 2 MB
    MMU: false
    Burst length: 4

[info] [2.097] Done elaborating.
[error] (run-main-0) firrtl.passes.PassExceptions: 
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 103:20]: [module ICache]  Expression ctrl.io.ctrlrepl is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 106:20]: [module ICache]  Expression ctrl.io.ocp_port is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 106:20]: [module ICache]  Expression io.ocp_port is used as a SourceFlow but can only be used as a SinkFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 107:16]: [module ICache]  Expression ctrl.io.perf is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 111:20]: [module ICache]  Expression repl.io.icachefe is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 112:20]: [module ICache]  Expression repl.io.replctrl is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 114:17]: [module ICache]  Expression repl.io.memIn is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.PassException: 7 errors detected!
[error] firrtl.passes.PassExceptions: 
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 103:20]: [module ICache]  Expression ctrl.io.ctrlrepl is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 106:20]: [module ICache]  Expression ctrl.io.ocp_port is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 106:20]: [module ICache]  Expression io.ocp_port is used as a SourceFlow but can only be used as a SinkFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 107:16]: [module ICache]  Expression ctrl.io.perf is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 111:20]: [module ICache]  Expression repl.io.icachefe is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 112:20]: [module ICache]  Expression repl.io.replctrl is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.CheckFlows$WrongFlow:  @[ICache.scala 114:17]: [module ICache]  Expression repl.io.memIn is used as a SinkFlow but can only be used as a SourceFlow.
[error] firrtl.passes.PassException: 7 errors detected!
[error] Nonzero exit code: 1
[error] (Compile / runMain) Nonzero exit code: 1
[error] Total time: 8 s, completed Dec 22, 2021 3:46:38 PM
schoeberl commented 2 years ago

Thanks for pointing this out. This is bad. I guess this is something that has never been tested at the port from Chisel 2 to Chisel 3.

schoeberl commented 2 years ago

Any chance that you could look into it and fix it?

michael-platzer commented 2 years ago

Any chance that you could look into it and fix it?

Sorry, I won't be able to look into this anytime soon.