embeded/FPGA - ALTERA2026. 10. 16. 23:30

fpga 다루는 언어인가?

 

scala 라는 언어에 포함 되어있는 하드웨어 

import 보이니 먼가 python 같으면서도 var 대신 val 이니 nodel.js 같기도 하고?

import chisel3._

class MyBundle extends Bundle {
  val foo = UInt(4.W)
  val bar = UInt(4.W)
}

class Foo extends Module {
  val bundle = Wire(new MyBundle)
  bundle.foo := 0xc.U
  bundle.bar := 0x3.U
  val uint = bundle.asUInt
  printf(cf"$uint") // 195

  // Test
  assert(uint === 0xc3.U)
}

[링크 : https://www.chisel-lang.org/docs]

[링크 : https://www.chisel-lang.org/]

 

import chisel3._
import chisel3.util.Counter
import circt.stage.ChiselStage

class Blinky(freq: Int, startOn: Boolean = false) extends Module {
  val io = IO(new Bundle {
    val led0 = Output(Bool())
  })
  // Blink LED every second using Chisel built-in util.Counter
  val led = RegInit(startOn.B)
  val (_, counterWrap) = Counter(true.B, freq / 2)
  when(counterWrap) {
    led := ~led
  }
  io.led0 := led
}

object Main extends App {
  // These lines generate the Verilog output
  println(
    ChiselStage.emitSystemVerilog(
      new Blinky(1000),
      firtoolOpts = Array("-disable-all-randomization", "-strip-debug-info")
    )
  )
}

[링크 : https://github.com/chipsalliance/chisel]

[링크 : https://en.wikipedia.org/wiki/Chisel_(programming_language)]

'embeded > FPGA - ALTERA' 카테고리의 다른 글

ghdl 사용해봄  (0) 2026.05.08
DE1-SOC LXDE 부팅 완료  (0) 2026.05.02
altera cyclone V HPS BOOTSEL, CLOCKSEL  (0) 2026.04.29
DE1-SOC getting started guide 따라하기  (0) 2026.04.28
nios II 단종  (0) 2026.03.22
Posted by 구차니