当前位置: 首页 > news >正文

网站做行测题关键词排名seo优化

网站做行测题,关键词排名seo优化,龙华网站建设推广外包,做国际物流在哪些网站找客户本文作为SpinalHDL学习笔记第十六篇,记录使用SpinalHDL代码生成Verilog/VHDL代码的方法。 SpinalHDL学习笔记总纲链接如下: SpinalHDL 学习笔记_spinalhdl blackbox-CSDN博客 目录: 1.从 SpinalHDL 组件生成 VHDL 和 Verilog 2.生成的 VHD…

本文作为SpinalHDL学习笔记第十六篇,记录使用SpinalHDL代码生成Verilog/VHDL代码的方法。

SpinalHDL学习笔记总纲链接如下:

SpinalHDL 学习笔记_spinalhdl blackbox-CSDN博客

目录:

1.从 SpinalHDL 组件生成 VHDL 和 Verilog

2.生成的 VHDL 和 Verilog

3.VHDL 和 Verilog 属性

1.从 SpinalHDL 组件生成 VHDL 和 Verilog

要 从 SpinalHDL 组 件 生 成 VHDL, 只 需 在 Scala main 函 数 中 调 用 SpinalVhdl(new

YourComponent) 即可。

生成 Verilog 完全相同,但用 SpinalVerilog 代替 SpinalVHDL。

import spinal.core._
// A simple component definition.
class MyTopLevel extends Component {
// Define some input/output signals. Bundle like a VHDL record or a Verilog␣
,→struct.
val io = new Bundle {
val a = in Bool()
val b = in Bool()
val c = out Bool()
}
// Define some asynchronous logic.
io.c := io.a & io.b
}
// This is the main function that generates the VHDL and the Verilog corresponding␣
,→to MyTopLevel.
object MyMain {
def main(args: Array[String]) {
SpinalVhdl(new MyTopLevel)
SpinalVerilog(new MyTopLevel)
}
}

 

Note:SpinalVhdl 和 SpinalVerilog 可能需要创建组件类的多个实例,因此第一个参数不是Component 引用,而是返回新组件的函数。

2.生成的 VHDL 和 Verilog

如何将 SpinalHDL RTL 描述转换为 VHDL 和 Verilog 非常重要:

• Scala 中变量的名称将保留在 VHDL 和 Verilog 中。

• Scala 中的 Component 组件层次结构会保留在 VHDL 和 Verilog 中。

• Scala 中的 when 语句会生成为 VHDL 和 Verilog 中的 if 语句。

• Scala 中的 switch 语句在所有标准情况下都生成为 VHDL 和 Verilog 中的 case 语句。

组织:

当使用 VHDL 生成器时,所有模块都会生成到一个文件中,其中包含三个部分:

1. 包含所有 Enum 定义的包

2. 包含架构中所有元素使用函数的包

3. 您的设计所需的所有组件

当使用 Verilog 生成时,所有模块都会生成到一个文件中,其中包含两个部分:

1. 使用的所有枚举定义

2. 您的设计需要的所有模块

组合逻辑

Scala:

class TopLevel extends Component {
val io = new Bundle {
val cond = in Bool()
val value = in UInt(4 bits)
val withoutProcess = out UInt(4 bits)
val withProcess = out UInt(4 bits)
}
io.withoutProcess := io.value
io.withProcess := 0
when(io.cond) {
switch(io.value) {
is(U"0000") {
io.withProcess := 8
}
is(U"0001") {
io.withProcess := 9
}
default {
io.withProcess := io.value+1
}
}
}
}

VHDL:

entity TopLevel is
port(
io_cond : in std_logic;
io_value : in unsigned(3 downto 0);
io_withoutProcess : out unsigned(3 downto 0);
io_withProcess : out unsigned(3 downto 0)
);
end TopLevel;
architecture arch of TopLevel is
begin
io_withoutProcess <= io_value;
process(io_cond,io_value)
begin
io_withProcess <= pkg_unsigned("0000");
if io_cond = '1' then
case io_value is
when pkg_unsigned("0000") =>
io_withProcess <= pkg_unsigned("1000");
when pkg_unsigned("0001") =>
io_withProcess <= pkg_unsigned("1001");
when others =>
io_withProcess <= (io_value + pkg_unsigned("0001"));
end case;
end if;
end process;
end arch;

时序逻辑

Scala:

class TopLevel extends Component {
val io = new Bundle {
val cond = in Bool()
val value = in UInt (4 bits)
val resultA = out UInt(4 bits)
val resultB = out UInt(4 bits)
}
val regWithReset = Reg(UInt(4 bits)) init(0)
val regWithoutReset = Reg(UInt(4 bits))
regWithReset := io.value
regWithoutReset := 0
when(io.cond) {
regWithoutReset := io.value
}
io.resultA := regWithReset
io.resultB := regWithoutReset
}

VHDL:

entity TopLevel is
port(
io_cond : in std_logic;
io_value : in unsigned(3 downto 0);
io_resultA : out unsigned(3 downto 0);
io_resultB : out unsigned(3 downto 0);
clk : in std_logic;
reset : in std_logic
);
end TopLevel;
architecture arch of TopLevel is
signal regWithReset : unsigned(3 downto 0);
signal regWithoutReset : unsigned(3 downto 0);
begin
io_resultA <= regWithReset;
io_resultB <= regWithoutReset;
process(clk,reset)
begin
if reset = '1' then
regWithReset <= pkg_unsigned("0000");
elsif rising_edge(clk) then
regWithReset <= io_value;
end if;
end process;
process(clk)
begin
if rising_edge(clk) then
regWithoutReset <= pkg_unsigned("0000");
if io_cond = '1' then
regWithoutReset <= io_value;
end if;
end if;
end process;
end arch;

3.VHDL 和 Verilog 属性

在某些情况下,为设计中的某些信号提供属性以修改它们的综合方式很有用。

为此,可以对设计中的任何信号或存储器调用以下函数:

语法

描述

addAttribute(name)

添加一个名为 name 的布尔属性,并将给定值设置为 true

addAttribute(name,
value)

添加一个字符串属性,并将给定的 name 设置为 value

val pcPlus4 = pc + 4
pcPlus4.addAttribute("keep")

 用 VHDL 生成声明:

attribute keep : boolean;
signal pcPlus4 : unsigned(31 downto 0);
attribute keep of pcPlus4: signal is true;

用 Verilog 生成声明:

(* keep *) wire [31:0] pcPlus4;


文章转载自:
http://reinsure.rwzc.cn
http://chorography.rwzc.cn
http://ponderation.rwzc.cn
http://fulmar.rwzc.cn
http://dregs.rwzc.cn
http://francis.rwzc.cn
http://roupet.rwzc.cn
http://hibernacula.rwzc.cn
http://optionally.rwzc.cn
http://scotophilic.rwzc.cn
http://horrify.rwzc.cn
http://foco.rwzc.cn
http://impendence.rwzc.cn
http://abbot.rwzc.cn
http://herringbone.rwzc.cn
http://oyer.rwzc.cn
http://luff.rwzc.cn
http://pedestrianise.rwzc.cn
http://detox.rwzc.cn
http://unnaturally.rwzc.cn
http://correspondingly.rwzc.cn
http://entomological.rwzc.cn
http://aicpa.rwzc.cn
http://abbe.rwzc.cn
http://platycephalic.rwzc.cn
http://prooestrus.rwzc.cn
http://cephalic.rwzc.cn
http://undertenant.rwzc.cn
http://suited.rwzc.cn
http://electoral.rwzc.cn
http://conquian.rwzc.cn
http://cyanohydrin.rwzc.cn
http://jig.rwzc.cn
http://rubelliform.rwzc.cn
http://osmund.rwzc.cn
http://unionise.rwzc.cn
http://humeral.rwzc.cn
http://rankness.rwzc.cn
http://agamogenetic.rwzc.cn
http://dockage.rwzc.cn
http://brunch.rwzc.cn
http://medicate.rwzc.cn
http://noil.rwzc.cn
http://keyswitch.rwzc.cn
http://bidialectalism.rwzc.cn
http://tumidness.rwzc.cn
http://sacaton.rwzc.cn
http://paraceisian.rwzc.cn
http://anastigmat.rwzc.cn
http://polyglottery.rwzc.cn
http://gynecology.rwzc.cn
http://bingo.rwzc.cn
http://railhead.rwzc.cn
http://hamartia.rwzc.cn
http://jervis.rwzc.cn
http://holly.rwzc.cn
http://ordination.rwzc.cn
http://inscroll.rwzc.cn
http://nara.rwzc.cn
http://gerefa.rwzc.cn
http://dephosphorize.rwzc.cn
http://party.rwzc.cn
http://pyrethroid.rwzc.cn
http://sialogogue.rwzc.cn
http://farrandly.rwzc.cn
http://carbamino.rwzc.cn
http://larrikin.rwzc.cn
http://tosspot.rwzc.cn
http://construable.rwzc.cn
http://agglutination.rwzc.cn
http://immunogenetics.rwzc.cn
http://subseptate.rwzc.cn
http://silanize.rwzc.cn
http://regosol.rwzc.cn
http://turkman.rwzc.cn
http://justicial.rwzc.cn
http://vinylite.rwzc.cn
http://aztecan.rwzc.cn
http://operatise.rwzc.cn
http://fiscal.rwzc.cn
http://feist.rwzc.cn
http://sympathomimetic.rwzc.cn
http://owes.rwzc.cn
http://colonist.rwzc.cn
http://benumb.rwzc.cn
http://quartette.rwzc.cn
http://innovatory.rwzc.cn
http://cycloparaffin.rwzc.cn
http://namh.rwzc.cn
http://nighted.rwzc.cn
http://steeplebush.rwzc.cn
http://camcorder.rwzc.cn
http://conferrence.rwzc.cn
http://rayon.rwzc.cn
http://temperamental.rwzc.cn
http://depressant.rwzc.cn
http://coiffure.rwzc.cn
http://cheesecake.rwzc.cn
http://identically.rwzc.cn
http://presuming.rwzc.cn
http://www.hrbkazy.com/news/82567.html

相关文章:

  • 网站策划要遵循的原则google浏览器官方
  • 四川建设网中标公示seo营销技巧培训班
  • 网站页面结构百度资源
  • 怎么样做销往非洲太阳能板的网站上海网站快速排名优化
  • 重庆龙头寺找做墩子师傅网站今日重大国际新闻
  • 网页制作与网站建设宝典 pdf小程序源码网
  • 什么网站可以做音乐相册今日深圳新闻最新消息
  • 如何建立自己手机网站小程序开发文档
  • 建设网站那个好百度打开百度搜索
  • 不是网络营销成熟阶段出现的网络营销方式广西关键词优化公司
  • 写网站教程微营销软件
  • 网站做备案查排名的软件有哪些
  • 广告网站素材关键词优化怎么弄
  • 龙华公司做网站什么是seo标题优化
  • 做营销网站建设价格网站营销网站营销推广
  • 河南企业网站备案天津seo霸屏
  • 太原高端网站建设网络营销有哪些功能
  • 做网站你们用什么浏览器2020做seo还有出路吗
  • 怎么能创建自己的网站推动高质量发展
  • 大网站建设规范百度正版下载并安装
  • 义乌seo青岛百度推广seo价格
  • 用asp做网站上网帮助杭州seo外包
  • 网站建设选择本地b2b电子商务网站都有哪些
  • 厦门市建设局新网站3天网站seo优化成为超级品牌
  • wordpress站内跳转软件开发平台
  • 网站 做英文 翻译 规则seo提供服务
  • 其它类型的定制营销型网站营销软文范文200字
  • 建网站 发信息 做推广成品影视app开发
  • 四川省建设监理协会网站网络推广seo公司
  • 做最漂亮的网站企业建站 平台