0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

現(xiàn)在公司里做設(shè)計(jì)是用SV還是Verilog?

ruikundianzi ? 來源:硅農(nóng) ? 2023-11-15 17:43 ? 次閱讀

省流:不同的公司風(fēng)格不同,都會使用。

數(shù)字電路設(shè)計(jì)主要就是,選擇器、全加器、比較器,乘法器,幾個常用邏輯門,再加個D觸發(fā)器,電路基本都能實(shí)現(xiàn)了。

切換到具體語法System Verilog本來就是Verilog的語法擴(kuò)展,所以Verilog支持的SV都支持。

組合邏輯用assign是同樣的,用always_comb代替always @*。

時(shí)序邏輯用always_ff @(posedge clk or negedge rst_n)代替always @(posedge clk or negedge rst_n)

信號聲明logic代替wire/reg。不用再繁瑣的區(qū)分?jǐn)?shù)據(jù)類型。

端口聲明可以用多維數(shù)組。一些處理用generate for不要太爽。

以上這幾條改變不大,可以無縫適應(yīng)。

接口Interface

SystemVerilog提供了一個新的、高層抽象的模塊連接,這個連接被稱為接口(Interface)。它可以將常用的比較規(guī)范的端口定義出來,方便集成連接。

舉個例子,首先定義一組interface,文件為interface.vh


interface chip_bus (input logic clock, resetn);
    logic interrupt_req, grant, ready;
    logic [31:0] address;
    wire [63:0] data;
    modport master (input interrupt_req,
        input address,
        output grant, ready,
        inout data,
        input clock, resetn);
    modport slave (output interrupt_req,
        output address,
        input grant, ready,
        inout data,
        input clock, resetn);
endinterface
然后在子模塊中就可以include使用這一組定義。
`include "interface.vh"
module primary(
chip_bus.mater    local_bus,
chip_bus.slave    primary_local_bus,
input        clock, 
input        resetn
);


endmodule


`include "interface.vh"
module secondary(
chip_bus.slave    local_bus,
chip_bus.master  secondary_local_bus,
`ifdef FPGA
input        fpga_clk,
`endif
input        clock, 
input        resetn
);


endmodule


最后在top中例化兩個子模塊,top上也可以定義interface,直接連接到子模塊,兩個子模塊之間的interface連接在頂層定義一個用于連線的interface。

`include "interface.vh"


module top (
chip_bus.master    secondary_local_bus,
chip_bus.slave    primary_local_bus,
`ifdef FPGA
input        fpga_clk,
`endif
input    clock, 
input    resetn
);


chip_bus local_bus();
 
primary u_primary(/*autoinst*/
        .local_bus              (local_bus.master               ), //interface//ahb_bus.mater
        .primary_local_bus      (primary_local_bus              ), //interface//axi_bus.slave
        .clock                  (clock                          ), //input
        .resetn                 (resetn                         )  //input
    );


secondary u_secondary(/*autoinst*/
        .local_bus              (local_bus.slave                ), //interface//ahb_bus.slave
        .secondary_local_bus    (secondary_local_bus            ), //interface//axi_bus.master
        `ifdef FPGA
        .fpga_clk               (fpga_clk                       ), //input
        `endif
        .clock                  (clock                          ), //input
        .resetn                 (resetn                         )  //input
    );


endmodule
使用interface可以提高集成的效率,不容易出錯,方便檢視。 當(dāng)然要是問我推薦用SV還是Verilog,我建議是遵守公司代碼規(guī)范,公司讓用啥就用啥。






審核編輯:劉清

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報(bào)投訴
  • 比較器
    +關(guān)注

    關(guān)注

    14

    文章

    1623

    瀏覽量

    107003
  • Verilog
    +關(guān)注

    關(guān)注

    28

    文章

    1338

    瀏覽量

    109871
  • D觸發(fā)器
    +關(guān)注

    關(guān)注

    3

    文章

    164

    瀏覽量

    47793
  • 數(shù)字電路
    +關(guān)注

    關(guān)注

    193

    文章

    1590

    瀏覽量

    80298

原文標(biāo)題:現(xiàn)在公司里做設(shè)計(jì)用SV還是Verilog?

文章出處:【微信號:IP與SoC設(shè)計(jì),微信公眾號:IP與SoC設(shè)計(jì)】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。

收藏 人收藏

    評論

    相關(guān)推薦

    FPGA編程是VHDL還是verilog HDL好用?謝謝了!

    FPGA編程是VHDL還是verilog HDL好用?謝謝了!{:soso_e183:}
    發(fā)表于 06-19 17:36

    FPGA編程是VHDL還是verilog HDL好用?謝謝了!

    [color=#444444 !important]FPGA編程是VHDL還是verilog HDL好用?謝謝了!
    發(fā)表于 06-19 17:39

    我是學(xué)Verilog還是VHDL?

    大學(xué)的一些學(xué)習(xí)材料??墒亲罱悬c(diǎn)迷茫,是學(xué)VHDL呢?還是學(xué)Verilog HDL。我網(wǎng)上查,有的說VHDL和Verilog HDL應(yīng)用情況差不多,可是又有人說現(xiàn)在主要是
    發(fā)表于 09-06 15:03

    硬件研發(fā)工作還是轉(zhuǎn)行去寫verilog代碼的工作

    年齡29歲,剛轉(zhuǎn)行硬件研發(fā)工作半年多,就是FPGA與MCU和搭配一些外圍電路設(shè)計(jì)的工作,好想有人去帶我,來了半年公司不忙,沒有做過項(xiàng)目,每天感覺好像在混日子,過得好空虛,目前在學(xué)習(xí)veri
    發(fā)表于 08-20 10:29

    現(xiàn)在公司基于SOPC項(xiàng)目的多嗎

    現(xiàn)在公司基于SOPC項(xiàng)目的多嗎???小白求教
    發(fā)表于 11-19 16:24

    請問在Verilog可以直接'/'來除法嗎?如果不能要怎樣除法呀??

    請問在Verilog可以直接'/'來除法嗎?如果不能要怎樣除法呀??希望知道的人能夠指點(diǎn)一二。。。
    發(fā)表于 09-08 11:33

    現(xiàn)在社會上Verilog與vhdl哪個的比較多?

    現(xiàn)在社會上Verilog與vhdl哪個的比較多?
    發(fā)表于 09-08 20:45

    ISSI公司的sram verilog model使用

    現(xiàn)在正在進(jìn)行fpga來讀寫sram的小項(xiàng)目,為了驗(yàn)證讀寫時(shí)序,我特地到ISSI公司官網(wǎng)聯(lián)系他們的技術(shù)人員給我發(fā)來了一個sram芯片的verilog model,我將其加入到我的工程中
    發(fā)表于 11-07 13:34

    Quartus II 現(xiàn)在verilog還是block dragram/schematic file

    現(xiàn)在verilog還是直接block dragram/schematic file ?新手感覺 block dragram/schematic file 更容易上手呢?感覺這邊很多
    發(fā)表于 09-27 16:27

    使用SpinalHDL狀態(tài)機(jī)生成的Verilog代碼如何導(dǎo)入到quartus工程中去呢

    “fsm_enumDefinition_binary_sequential_fsm_BOOT=2'b00”通過這種方式添加可以避免再去修改生成的Verilog代碼。我們在工程基于Scala可以很方便的解析enumdefine.sv
    發(fā)表于 07-08 16:13

    Altera公司FPGADSP算法的工具

    Altera公司FPGADSP算法的工具
    發(fā)表于 03-25 13:46 ?39次下載

    Verilog實(shí)現(xiàn)8255芯片功能

    Verilog實(shí)現(xiàn)8255芯片功能
    發(fā)表于 11-03 17:06 ?144次下載

    太陽能電池地板(是浪費(fèi)還是回收)

    太陽能電池地板(是浪費(fèi)還是回收)
    發(fā)表于 04-10 08:38 ?651次閱讀

    淺談System Verilog的DPI機(jī)制

    System Verilog(SV)把其他編程語言統(tǒng)一成為外語,F(xiàn)oreign Programming Language(FPL)。
    的頭像 發(fā)表于 05-23 15:39 ?1840次閱讀
    淺談System <b class='flag-5'>Verilog</b>的DPI機(jī)制

    算法要學(xué)python還是C++?

    ,計(jì)算機(jī),就是用來計(jì)算的,所以計(jì)算一直都是核心。不管是用電腦畫圖,Excel表格,還是智能手機(jī)購物,看電影聽音樂,實(shí)際上體現(xiàn)在機(jī)器中都
    的頭像 發(fā)表于 03-08 09:41 ?532次閱讀
    <b class='flag-5'>做</b>算法要學(xué)python<b class='flag-5'>還是</b>C++?