NVBoard项目搭建

ysyx · 02-16 · 935 人浏览
NVBoard项目搭建

在刚接触NVBoard时感到非常棘手,因为不知道怎么配置引脚,也不知道怎么在cpp文件中接入nvboard,后来想到了阅读example项目的makefile,尝试模仿example的项目结构搭建,最后算是顺利完成了~

Step 0

配置环境,具体见README

https://github.com/NJU-ProjectN/nvboard

Step 1

创建项目框架

.
├── constr
│   └── top.nxdc
├── csrc
│   └── nvb.cpp
├── makefile
└── vsrc
    ├── MuxKeyInternal.v
    ├── MuxKey.v
    ├── MuxKeyWithDefault.v
    └── top.v

共3个目录(constr, csrc, vsrc),1个makefile文件

makefile文件我是直接复制的官方仓库/example/Makefile

Step 2

编写好.cpp文件,其实就是根据手册上说的:

  • 在进入verilator仿真的循环前,先对引脚进行绑定,然后对NVBoard进行初始化
  • 在verilator仿真的循环中更新NVBoard各组件的状态
  • 退出verilator仿真的循环后,销毁NVBoard的相关资源

2.17 Update:

main.cpp其实只要有如下框架即可,不需要自己写激励了,因为修改NVBoard FPGA板的输入(比如拨动SW)就是一种激励。

#include <nvboard.h>
#include <Vtop.h>

void nvboard_bind_all_pins(Vtop* top);

int main(int argc, char** argv) {
    VerilatedContext* contextp = new VerilatedContext;
    contextp->commandArgs(argc, argv);
    Vtop* top = new Vtop{contextp};

    nvboard_bind_all_pins(top);
    nvboard_init();
    while(!contextp->gotFinish())
        {
            top->eval();
            nvboard_update();
        }

    nvboard_quit();
    return 0;
}
Note: 绑定多个引脚时,从左到右是MSB->LSB

Step 3

在项目根目录下执行

make run

Summary

以后要养成习惯,不知道怎么下手时先看示例是怎么写的,模仿着来就可以,同时要阅读示例的README

ysyx verilog NVBoard
  1. FrankAnymn 8 天前

    Big cocks of blacks are fake. A setup for HIV.

    In Africa, it is legal to store p**** only in South Africa. Where there are whites.

    That is, it doesn't work for them and they are ashamed of their real size.

    I plan to stop practicing when a Russian citizen goes to sleep with a black man. It will be possible, but it will cost a lot of money. We need to stop squandering women.

    How everything most likely works in the USA. Negroes supply drugs, and studios paint them huge sizes. The West is rotten. It's time to get out of there. They don't appreciate women.

    __

    How negroes get to know white girls

    Most likely they get hooked on drugs. They don't have much money. I suggest checking all Blacks for drugs, and the girls who date them.

    And also to introduce a life sentence for drug trafficking in Russia.

    __

    I propose to introduce a mandatory collection of money from 18+ sites where there is at least one video of a black man with a white woman. Including hentai.

    In case of refusal, exclusion from search engine results.

    Let's make it unprofitable, without blocking.

    If you censor such content, it will work the other way around, according to the principle of "forbidden fruit is sweet."

Theme Jasmine by Kent Liao