新手入门的简单小例子-05-重制版02顶层文件 - FPGA开发者技术社区 - 电子技术william hill官网 - 广受欢迎的专业电子william hill官网 - 威廉希尔官方网站
分享 收藏 返回

商周 关注 私信
[文章]

新手入门的简单小例子-05-重制版02顶层文件

对应的顶层模块实际code如下:

module Clock_TOP(
input wire clk,
input wire rst_n,
input wire KEY_A,
input wire KEY_B,
input wire KEY_C,

output wire DS,
output wire SCLK,
output wire SRLK
	);

wire [2:0] S_SEL;
wire [7:0] Decoder_OUT;
wire [7:0] LUT_OUT;
wire [3:0] value1,value2,value3,value4,value5,value6,value7,value8;
wire [3:0] Control_Data;
wire [3:0] MUX_OUT;

CNT  CNT_inst
(
.clk            ( clk ),
.rst_n          ( rst_n ),

.OUT            ( S_SEL )
	);

Decoder38   Decoder38_inst
 (
 .IN            ( S_SEL ),
 
 .OUT           ( Decoder_OUT )
 	); 

MUX  MUX_inst(
.IN1       ( value1 ),
.IN2       ( value2 ),
.IN3       ( value3 ),
.IN4       ( value4 ),
.IN5       ( value5 ),
.IN6       ( value6 ),
.IN7       ( value7 ),
.IN8       ( value8 ),
.SEL       ( S_SEL  ),

.MUX_OUT   ( MUX_OUT )
);

LUT  LUT_inst(
.IN       ( MUX_OUT ),

.LUT_OUT  ( LUT_OUT )
);

HC595Driver HC595Driver_inst(
.clk    ( clk   ),
.rst_n  ( rst_n ),
.Data   ({LUT_OUT,Decoder_OUT}),
.DS     ( DS ),
.SCLK   ( SCLK ),
.SRLK   ( SRLK )
	);


Time_CNT Time_CNT_inst(
.clk    ( clk   ),
.rst_n  ( rst_n ),
.IN     ( Control_Data ),
.value1 ( value1 ),
.value2 ( value2 ),
.value3 ( value3 ),
.value4 ( value4 ),
.value5 ( value5 ),
.value6 ( value6 ),
.value7 ( value7 ),
.value8 ( value8 )
	);

KEY_Uint KEY_Uint_inst(
.clk      ( clk   ),
.rst_n    ( rst_n ),
.KEY_A    ( KEY_A ),
.KEY_B    ( KEY_B ),
.KEY_C    ( KEY_C ),
.Press_A  ( Control_Data[0] ),
.Press_B  ( Control_Data[1] ),
.SetFlag  ( Control_Data[3:2])
	);




endmodule

更多回帖

×
发帖