FPGA基础知识培训蒋伟教案.pptVIP

  • 6
  • 0
  • 约 68页
  • 2016-11-06 发布于湖北
  • 举报
2、Verilog HDL语言基础 2.7 行为级建模 时序控制 分为:延时控制 和 事件控制 延时控制: #5 a = b; 事件控制: @( a or b or c) 等价 @( a , b , c) @(posedge clk ) 2、Verilog HDL语言基础 2.7 行为级建模 流控制 流控制语句包括:跳转、分支和循环语句 if语句 if ( ) else if( ) else case语句 case ( ) casex( ) casez( ) 表达式:声明; default: 声明; endcase endcase endcase 循环语句 for () 、 while()、 forever、repeat 2、Verilog HDL语言基础 2.7 行为级建模 task任务 声明:task………endtask module fpga_train(); always @( posedge clk1 ) begin and_operation( ab_and , a , b); //变量的指定必须按照定义的顺序! end always @( posedge clk2 ) begin and_operation( cd_and , c , d); end task automatic and_operation; //自动任务 output ab_and_inst; input a_inst, b_inst; begin ab_and_inst = a_inst b_inst; end endtask; endmodule 2、Verilog HDL语言基础 2.7 行为级建模 function任务 module fpga_train(); always @( posedge clk1 ) begin c = and_operation( a , b); end function automatic [ 7 : 0] and_operation; //自动函数,生成一个名为函数标识符的寄存器变量 input a_inst, b_inst; begin and_operation = a_inst b_inst; end endfunction; endmodule 2、Verilog HDL语言基础 2.7 行为级建模 task和function的区别 1、函数至少有一个输入变量,任务不定。 2、函数必须有一个返回值。任务不返回值,可通过OUT变量传递值。 3、函数不能包含延迟、事件、时序控制,任务可包含。 4、函数可调用函数,不能调用任务。任务可调用任务和函数。 Translate Map Place Route Plan Budget HDL RTL Simulation Synthesize to Create Netlist Functional Simulation Create BIT File Attain Timing Closure Timing Simulation Implement Create Code/ Schematic 3、如何使用ISE开发环境 3.1 ISE开发流程 Project Navigator windows Sources Processes Summary Working Message 3、如何使用ISE开发环境 3.2 ISE交互窗口 Select File ? New Project New Project Wizard guides you through the proce

文档评论(0)

1亿VIP精品文档

相关文档