generated from chipsalliance/chisel-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增多個設定檔和模組,包括 GCD 模組、記憶體模組及其測試,並更新相關的配置文件
- Loading branch information
Showing
46 changed files
with
4,859 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"javaSemanticDBVersion": "0.10.3", | ||
"semanticDBVersion": "4.12.3", | ||
"supportedScalaVersions": [ | ||
"2.13.16", | ||
"2.12.20", | ||
"2.12.19", | ||
"2.12.18", | ||
"2.12.17", | ||
"2.13.12", | ||
"2.13.13", | ||
"2.13.14", | ||
"2.13.15", | ||
"2.11.12" | ||
], | ||
"enableBestEffortMode": false | ||
} |
Binary file not shown.
Binary file added
BIN
+13.4 KB
...-P_CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/test/scala/gcd/GCDSpec.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+5.6 KB
...s-P_CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/test/scala/lw/CPUtest.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+13.4 KB
...-BPJ2LvRQTBKx87KJCU326g==/META-INF/semanticdb/src/test/scala/gcd/GCDSpec.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+5.6 KB
...=-BPJ2LvRQTBKx87KJCU326g==/META-INF/semanticdb/src/test/scala/lw/CPUtest.scala.semanticdb
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+27.4 KB
...P_CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/common/Const.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+10.6 KB
...1Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/common/Instructions.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+16.4 KB
...W581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/gcd/DecoupledGCD.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+7.58 KB
...tals-P_CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/gcd/GCD.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+73.5 KB
...tals-P_CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/lw/Core.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+15.5 KB
...CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/lw/InstrDecode.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+12.7 KB
...ls-P_CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/lw/Memory.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+5.86 KB
...etals-P_CEW581Tde6PXPJ9Fj2fw==/META-INF/semanticdb/src/main/scala/lw/Top.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+27.4 KB
...SRGP15brSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/common/Const.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+10.6 KB
...rSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/common/Instructions.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+16.4 KB
...15brSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/gcd/DecoupledGCD.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+7.58 KB
...fw==-SRGP15brSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/gcd/GCD.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+73.5 KB
...fw==-SRGP15brSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/lw/Core.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+15.5 KB
...GP15brSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/lw/InstrDecode.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+12.7 KB
...==-SRGP15brSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/lw/Memory.scala.semanticdb
Binary file not shown.
Binary file added
BIN
+5.86 KB
...2fw==-SRGP15brSkG9LtepUEDLlw==/META-INF/semanticdb/src/main/scala/lw/Top.scala.semanticdb
Binary file not shown.
183 changes: 183 additions & 0 deletions
183
.metals/.reports/metals-full/2025-01-11/r_compiler-error_17-05-33-841.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
file://wsl.localhost/Ubuntu-22.04/home/user/workspace/SV32e/src/main/scala/lw/Core.scala | ||
### java.lang.AssertionError: assertion failed: position error, parent span does not contain child span | ||
parent = new DmemPortIo(_root_.scala.Predef.???) # -1, | ||
parent span = <225..271>, | ||
child = _root_.scala.Predef.??? # -1, | ||
child span = [240..275..275] | ||
|
||
occurred in the presentation compiler. | ||
|
||
presentation compiler configuration: | ||
|
||
|
||
action parameters: | ||
uri: file://wsl.localhost/Ubuntu-22.04/home/user/workspace/SV32e/src/main/scala/lw/Core.scala | ||
text: | ||
```scala | ||
package lw | ||
|
||
import chisel3._ | ||
import chisel3.util._ | ||
import common.Consts._ | ||
import common.Instructions._ | ||
|
||
class Core extends Module { | ||
val io = IO(new Bundle { | ||
val imem = Flipped(new ImemPortIo()) | ||
val dmem = new DmemPortIo( | ||
val exit = Output(Bool()) | ||
}) | ||
|
||
val regfile = Mem(32, UInt(WORD_LEN.W)) | ||
|
||
|
||
//********************************** | ||
// Instruction Fetch (IF) Stage | ||
|
||
val pc_reg = RegInit(START_ADDR) | ||
pc_reg := pc_reg + 4.U(WORD_LEN.W) | ||
io.imem.addr := pc_reg | ||
val inst = io.imem.inst | ||
|
||
//********************************** | ||
// Instruction Decode (ID) Stage | ||
|
||
val rs1_addr = inst(19, 15) | ||
val rs2_addr = inst(24, 20) | ||
val wb_addr = inst(11, 7) | ||
|
||
val rs1_data = Mux((rs1_addr =/= 0.U(ADDR_LEN.W)), regfile(rs1_addr), 0.U(WORD_LEN.W)) | ||
val rs2_data = Mux((rs2_addr =/= 0.U(ADDR_LEN.W)), regfile(rs2_addr), 0.U(WORD_LEN.W)) | ||
|
||
//********************************** | ||
// Execute (EX) Stage | ||
|
||
val alu_out = Muxcase(0.U(WORD_LEN.W), Seq( | ||
(inst === LW ) -> (rs1_data + imm_i_sext) // Calculation of memory addresses | ||
)) | ||
|
||
|
||
//********************************** | ||
//Memory (MEM) Stage | ||
|
||
io.dmem.addr := alu_out | ||
|
||
|
||
|
||
//********************************** | ||
// Writeback (WB) Stage | ||
|
||
val wb-data = io.dmem.data | ||
|
||
when(inst === LW) { | ||
regfile(wb_addr) := wb_data | ||
} | ||
|
||
|
||
|
||
|
||
//********************************** | ||
// Debug | ||
io.exit := (inst === 0x23222120.U(WORD_LEN.W)) | ||
printf(p"pc_reg : 0x${Hexadecimal(pc_reg)}\n") | ||
printf(p"inst : 0x${Hexadecimal(inst)}\n") | ||
printf(p"rs1_addr : $rs1_addr\n") | ||
printf(p"rs2_addr : $rs2_addr\n") | ||
printf(p"wb_addr : $wb_addr\n") | ||
printf(p"rs1_data : 0x${Hexadecimal(rs1_data)}\n") | ||
printf(p"rs2_data : 0x${Hexadecimal(rs2_data)}\n") | ||
printf(p"wb_data : 0x${Hexadecimal(wb_data)}\n") | ||
printf(p"dmem.addr : ${io.dmem.addr}\n") | ||
printf("---------\n") | ||
} | ||
``` | ||
|
||
|
||
|
||
#### Error stacktrace: | ||
|
||
``` | ||
scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:175) | ||
dotty.tools.dotc.ast.Positioned.check$1$$anonfun$3(Positioned.scala:205) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) | ||
scala.collection.immutable.List.foreach(List.scala:334) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:205) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.check$1$$anonfun$3(Positioned.scala:205) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) | ||
scala.collection.immutable.List.foreach(List.scala:334) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:205) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.check$1$$anonfun$3(Positioned.scala:205) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) | ||
scala.collection.immutable.List.foreach(List.scala:334) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:205) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.check$1$$anonfun$3(Positioned.scala:205) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) | ||
scala.collection.immutable.List.foreach(List.scala:334) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:205) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:200) | ||
dotty.tools.dotc.ast.Positioned.check$1$$anonfun$3(Positioned.scala:205) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) | ||
scala.collection.immutable.List.foreach(List.scala:334) | ||
dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:205) | ||
dotty.tools.dotc.ast.Positioned.checkPos(Positioned.scala:226) | ||
dotty.tools.dotc.parsing.Parser.parse$$anonfun$1(ParserPhase.scala:39) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) | ||
dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:458) | ||
dotty.tools.dotc.parsing.Parser.parse(ParserPhase.scala:40) | ||
dotty.tools.dotc.parsing.Parser.$anonfun$2(ParserPhase.scala:52) | ||
scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479) | ||
scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:583) | ||
scala.collection.immutable.List.prependedAll(List.scala:152) | ||
scala.collection.immutable.List$.from(List.scala:685) | ||
scala.collection.immutable.List$.from(List.scala:682) | ||
scala.collection.IterableOps$WithFilter.map(Iterable.scala:900) | ||
dotty.tools.dotc.parsing.Parser.runOn(ParserPhase.scala:51) | ||
dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:315) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) | ||
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) | ||
scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323) | ||
dotty.tools.dotc.Run.runPhases$1(Run.scala:308) | ||
dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:349) | ||
dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:358) | ||
dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69) | ||
dotty.tools.dotc.Run.compileUnits(Run.scala:358) | ||
dotty.tools.dotc.Run.compileSources(Run.scala:261) | ||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:161) | ||
dotty.tools.pc.MetalsDriver.run(MetalsDriver.scala:45) | ||
dotty.tools.pc.WithCompilationUnit.<init>(WithCompilationUnit.scala:31) | ||
dotty.tools.pc.SimpleCollector.<init>(PcCollector.scala:345) | ||
dotty.tools.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:63) | ||
dotty.tools.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:63) | ||
dotty.tools.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:63) | ||
dotty.tools.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:88) | ||
dotty.tools.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:109) | ||
``` | ||
#### Short summary: | ||
|
||
java.lang.AssertionError: assertion failed: position error, parent span does not contain child span | ||
parent = new DmemPortIo(_root_.scala.Predef.???) # -1, | ||
parent span = <225..271>, | ||
child = _root_.scala.Predef.??? # -1, | ||
child span = [240..275..275] |
Oops, something went wrong.