烟台论坛网

 找回密码
 立即注册
搜索
查看: 880|回复: 1
打印 上一主题 下一主题

怎样对一个數字verilog程序編寫的流水线加法器做PT和ASTRO

[复制链接]

41

主题

101

帖子

153

积分

注册会员

Rank: 2

积分
153
跳转到指定楼层
楼主
发表于 2020-3-31 20:38:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    文章简介:我在做一个verilog编写的8位四级流水线加法器,这是我第一次做全流程{stage1_cout,stage1_sum}<={{1'b0,sta{stage2_cout,stage2_sum}<={{1'b0,sta{stage3_cout,stage3_sum}<={{stage2_a



我在做一个verilog编写的8位四级流水线加法器,这是我第一次做全流程的设计。从verilog设计编寫、功能仿真、逻辑综合、时序分析然后做布局布线。现在卡在PT这了,不会做了,求助大神们帮帮忙!下面的程序:
moduleadder_pipeline(rst_n,clk,a,b,cin,sum);   
parameter     DATA_SIZE = 8;
input rst_n;
input clk;
input [DATA_SIZE -1 : 0] a;
input [DATA_SIZE -1 : 0] b;   
input cin;
output [DATA_SIZE: 0] sum;
reg [DATA_SIZE - 1: 0] a_r;
reg [DATA_SIZE - 1: 0] b_r;
reg cin_r;
reg [DATA_SIZE :0] sum;
reg [1:0]stage0_sum;
reg stage0_cout;
reg [DATA_SIZE - 1: 0] stage0_a_r;
reg [DATA_SIZE - 1: 0] stage0_b_r;
reg [3:0]stage1_sum;
reg stage1_cout;
reg [DATA_SIZE - 1: 0] stage1_a_r;
reg [DATA_SIZE - 1: 0] stage1_b_r;
reg [5:0]stage2_sum;
reg stage2_cout;
reg [DATA_SIZE - 1: 0] stage2_a_r;
reg [DATA_SIZE - 1: 0] stage2_b_r;
reg [7:0]stage3_sum;
reg stage3_cout;
always@(posedgeclk)
     if(!rst_n)
         begin
             a_r <= 8'd0;
             b_r <= 8'd0;
             cin_r <= 1'b0;
         end
     else
         begin
             a_r <= a;
             b_r <= b;
             cin_r <= cin;
         end
always@(posedgeclk)
     if(!rst_n)
         begin
             {stage0_cout,stage0_sum} <=3'd0;
             stage0_a_r <= 8'd0;
             stage0_b_r <= 8'd0;        
         end
     else
         begin
              {stage0_cout,stage0_sum} <={1'b0,a_r[1:0]} + {1'b0,b_r[1:0]} + cin_r;               
             stage0_a_r <= a_r;
            stage0_b_r <= b_r;        
         end
always@(posedge clk)
     if(!rst_n)
         begin
             {stage1_cout,stage1_sum} <=5'd0;
             stage1_a_r <= 8'd0;
             stage1_b_r <= 8'd0;   
         end
     else
         begin
             {stage1_cout,stage1_sum} <= {{1'b0,stage0_a_r[3:2]} + {1'b0,stage0_b_r[3:2]} + stage0_cout,stage0_sum };
             stage1_a_r <= stage0_a_r;
             stage1_b_r <= stage0_b_r;
         end        
always@(posedge clk)
     if(!rst_n)
         begin
             {stage2_cout,stage2_sum} <=7'd0;
             stage2_a_r <= 8'd0;
             stage2_b_r <= 8'd0;   
         end
     else
         begin
             {stage2_cout,stage2_sum} <= {{1'b0,stage1_a_r[5:4]} + {1'b0,stage1_b_r[5:4]} + stage1_cout,stage1_sum};            
             stage2_a_r <= stage1_a_r;
             stage2_b_r <= stage1_b_r;
         end        
always@(posedge clk)
     if(!rst_n)
         begin
             {stage3_cout,stage3_sum} <=9'd0;
         end
     else
         begin
             {stage3_cout,stage3_sum} <= {{stage2_a_r[7],stage2_a_r[7:6]} + {stage2_b_r[7],stage2_b_r[7:6]} +stage2_cout,stage2_sum };   
         end
  always@(posedge clk)
     if(!rst_n)
         begin
             sum <= 9'd0;
         end
     else
         begin
             sum <={stage3_cout,stage3_sum};        
         end
         
endmodule
接下来的时序分析,怎么用虚拟机做我就不会了

欢迎来到烟台论坛网--山东烟台百姓生活信息网! 请记住我们的网址 www.goo0.cn
回复

使用道具 举报

44

主题

101

帖子

156

积分

注册会员

Rank: 2

积分
156
沙发
发表于 2020-3-31 20:38:54 | 只看该作者
太牛了,从前端到后端,

基本要靠flow支持的, 要教会很累的, 几句话说不清楚
欢迎来到烟台论坛网--山东烟台百姓生活信息网! 请记住我们的网址 www.goo0.cn
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|联系我们|山东烟台网

GMT+8, 2025-5-2 15:21 , Processed in 0.156250 second(s), 19 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表