|
发表于 2010-8-12 23:50:18
|
显示全部楼层
在C中只能对A、B进行实例化,不能再有其它的非结构级的代码
以下是我的一个设计的顶层模块代码,只有结构级代码:
// Created by ihdl
module AFCFast(sband, AFCdone, AFCnomatch, Fref, Fcmp, AFCstart, Ncmp);
output [3:0] sband;
output AFCdone, AFCnomatch;
input Fref, Fcmp, AFCstart;
input [10:0] Ncmp;
wire [11:0] Ncount; // Fcmp counter's output
wire [10:0] Ncmp_eff; // NcmpLoader's output
and (Fcmp_gated, Fcmp, CMPen_n);
and (Fref_gated, Fref, C64_n);
CountFcmpFast CountFcmpInst(.data(Ncount),
.clk(Fcmp_gated), .rst_n(Rst));
CountFrefFast CountFrefInst(.C64(C64), .C64_n(C64_n), .CMPen(CMPen), .CMPen_n(CMPen_n),
.clk(Fref_gated), .rst_n(Rst));
CompareFast CompareInst(.up(up), .proper(proper), .down(down), .noproper_n(noproper_n),
.Ncount(Ncount), .Ncmp(Ncmp_eff), .CMPen(CMPen));
NcmpLoaderFast NcmpLoadInst(.Ncmp_out(Ncmp_eff),
.Fref(Fref), .CMPen(CMPen), .Load_n(Rst), .Ncmp_in(Ncmp));
DFFFast DFFup_Inst(.Qout(up_d1),
.clk(CMPen_d1), .rst_n(AFCstart), .Din(up));
DFFFast DFFproper_Inst(.Qout(proper_d1),
.clk(CMPen_d1), .rst_n(AFCstart), .Din(proper));
DFFFast DFFdown_Inst(.Qout(down_d1),
.clk(CMPen_d1), .rst_n(AFCstart), .Din(down));
DFFFast DFF_C64_Inst(.Qout(C64_d1),
.clk(CMPen_d1), .rst_n(AFCstart), .Din(C64));
DFFFast DFF_CMPen_d1_Inst(.Qout(CMPen_d1),
.clk(Fref), .rst_n(AFCstart), .Din(CMPen));
DFFFast DFF_FSMclk_Inst(.Qout(FSMclk),
.clk(Fref), .rst_n(AFCstart), .Din(CMPen_d1));
FSMFast FSM_Inst(.sband(sband),
.next(gonextband), .done(AFCdone), .nomatch(AFCnomatch),
.clk(FSMclk), .rst_n(AFCstart),
.up(up_d1), .proper(proper_d1), .down(down_d1), .C64(C64_d1));
// generate Rst for counters
and (Rst0, noproper_n, gonextband);
DFFFast DFF_Rst1_Inst(.Qout(Rst1),
.clk(Fref), .rst_n(AFCstart), .Din(Rst0));
DFFFast DFF_Rst2_Inst(.Qout(Rst),
.clk(Fref), .rst_n(AFCstart), .Din(Rst1));
endmodule
1# 211lili |
|