在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
EETOP诚邀模拟IC相关培训讲师 创芯人才网--重磅上线啦!
查看: 3282|回复: 4

pci9054 局部总线控制器 代码

[复制链接]
发表于 2008-10-30 21:38:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
//*******************fsm**********************
        always @(posedge lclk)
                if (reset)
                        Pci_Csta <= s0_idle;
                else
                        Pci_Csta <= Pci_Nsta;
                                               
        //Next state logic
        always @ (ads_b or blast_b or  Pci_Csta)  //rdy_b or  or lclk  
        begin
            Pci_Nsta=Pci_Csta;
                case (Pci_Csta)
                        s0_idle: if (!ads_b)
                                        Pci_Nsta = s1_start;
                                else
                                        Pci_Nsta = s0_idle;
                                       
                        s1_start: if (!blast_b)
                                        Pci_Nsta = s2_single_wait;
                                else if (blast_b)
                                        Pci_Nsta = s4_burst_wait;
                                else
                                        Pci_Nsta = s1_start;
                                       
                        s2_single_wait:
                                        Pci_Nsta = s3_single_last;

                        s3_single_last: if (!ads_b)
                                        Pci_Nsta = s1_start;
                                else
                                        Pci_Nsta = s0_idle;
                                       
                        s4_burst_wait: Pci_Nsta = s5_burst_repeat;
                       
                        s5_burst_repeat: if (blast_b)
                                        Pci_Nsta = s5_burst_repeat;
                                else
                                        Pci_Nsta = s6_burst_last;
                                       
                        s6_burst_last: if (!ads_b)
                                        Pci_Nsta = s1_start;
                                else
                                        Pci_Nsta = s0_idle;
                                       
                        default:
                                Pci_Nsta = s0_idle;
                endcase
        end
               
        //output logic
        always @ (posedge lclk)
                begin
                lrdy<=1'b1;
                case(Pci_Nsta)
                        s0_idle: begin
                                lrdy <=1;
//                                watch_sta<=3'b000;
                        end
                       
                        s1_start: begin
                                lrdy <=1;
//                                watch_sta<=3'b001;
                        end
                       
                        s2_single_wait: begin
                                lrdy<=0;//2008/07/04 15:33
//                                watch_sta<=3'b010;
                        end
                               
                        s3_single_last: begin
                                lrdy<=1;
//                                watch_sta<=3'b011;
                        end
                       
                        s4_burst_wait: begin
                                lrdy<=1;
//                                watch_sta<=3'b100;
                        end
                       
                        s5_burst_repeat: begin
                                lrdy<=0;
//                                watch_sta<=3'b101;
                        end
                       
                        s6_burst_last: begin
                                lrdy<=1;
//                                watch_sta<=3'b110;
                        end
                       
                        default: begin
                                lrdy<=1;
//                                watch_sta<=3'b110;
                        end
                endcase
           end
       

               

//------------------------------------------------               
        // local bus arbitration
        always @(posedge lclk)
                if (lhold)
                        lholda <= lhold;
                else
                        lholda <= 1'b0;
发表于 2009-12-6 16:52:47 | 显示全部楼层
最好详细说明下啊
发表于 2011-4-2 13:49:42 | 显示全部楼层
有代码说明或者注释什么的没?
发表于 2012-2-6 14:51:36 | 显示全部楼层
thank you very much!!!
发表于 2012-9-24 09:33:08 | 显示全部楼层
这个是通用的吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-24 04:32 , Processed in 0.048816 second(s), 13 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表