generated from schoeberl/chisel-empty
-
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.
RoPE 모듈 초안 작성 -> Int임. FP 쓸려면 별도의 라이브러리 필요
- Loading branch information
Showing
4 changed files
with
41 additions
and
58 deletions.
There are no files selected for viewing
This file was deleted.
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,24 @@ | ||
/* | ||
* Dummy file to start a Chisel project. | ||
* | ||
* Author: Martin Schoeberl ([email protected]) | ||
* | ||
*/ | ||
|
||
package vfrope | ||
|
||
import chisel3._ | ||
import chisel3.util._ | ||
|
||
class RoPEModule(width:Int) extends Module{ | ||
val io = IO(new Bundle{ | ||
val m = Input(UInt(width.W)) | ||
val theta = Input(UInt(width.W)) | ||
val i = Input(UInt(width.W)) | ||
val out = Output(UInt(width.W)) | ||
}) | ||
|
||
val m_theta_i = RegInit(0.U(width.W)) | ||
m_theta_i := io.m * io.theta * io.i | ||
io.out := m_theta_i | ||
} |
This file was deleted.
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 @@ | ||
package vfrope | ||
|
||
import chisel3._ | ||
import chiseltest._ | ||
import org.scalatest.flatspec.AnyFlatSpec | ||
|
||
class RoPEModuleTester extends AnyFlatSpec with ChiselScalatestTester { | ||
"RoPEModule" should "work" in { | ||
test(new RoPEModule(width = 8)) { dut => | ||
dut.io.m.poke(2.U) | ||
dut.io.theta.poke(1.U) | ||
dut.io.i.poke(1.U) | ||
dut.clock.step(1) | ||
dut.io.out.expect(2.U) | ||
} | ||
} | ||
} |