Vengineerの戯言

人生は短いけど、長いです。人生を楽しみましょう!

Xilinx FINN v0.2b beta

@Vengineerの戯言 : Twitter
SystemVerilogの世界へようこそすべては、SystemC v0.9公開から始まった 

このブログでも、2月23日に取り上げた Xilinx の FINN 

vengineer.hatenablog.com

XilinxのFINN v0.2b (beta)がリリースされたようです。

xilinx.github.io

Function Verificationのページを眺めていたら、下記のような説明がありました。

引用します。この中で、PyVerilatorというのがあって、PythonからVerilatorをコントロールするみたいです。Yaman Umuroglu さん(FINNをやっている人)の Fork もあり、こちらの PyVerilator を使えばいいようですね。

 

Simulation using Python

This simulation can be used right after the Brevitas Export or when the network does not contain any HLS custom nodes, so right after the streamlining transformations and before the nodes are converted into HLS layers.

Simulation using C++

This simulation can be used for a model containing several HLS custom operations. Because they are based on finn-hlslib function, C++ code can be generated from this single nodes and they can be executed by compiling the code and running the resulting executables.

Emulation using PyVerilator

The emulation using PyVerilator can be used when IP blocks were generated, either node by node or of a whole design. For that purpose PyVerilator gets the generated verilog files.

PyVerilatorの例題:simple_example.py  を見てみると、

sim = pyverilator.PyVerilator.build('counter.v')

 で、Verilog HDLのコードを読みこみ、Verilatorでビルドし、

# start gtkwave to view the waveforms as they are made
sim.start_gtkwave()

# add all the io and internal signals to gtkwave
sim.send_to_gtkwave(sim.io)
sim.send_to_gtkwave(sim.internals)

にて、GTKWave への波形ダンプ信号を指定し、その後、入力信号(CLK、Reset)を駆動しています。