请教下面的语句,一般如何用fpga实现
assign o_cclk = (en)?(~i_cclk):1'h1;
一个LUT搞定
请教?如何实现?
我是这么实现的,对不?有别的方法么?
BUFGCTRL #(
.INIT_OUT(1), // Initial value of BUFGCTRL output ($VALUES;)
.PRESELECT_I0("TRUE"), // BUFGCTRL output uses I0 input ($VALUES;)
.PRESELECT_I1("FALSE") // BUFGCTRL output uses I1 input ($VALUES;)
)
BUFGCTRL_inst (
.O(o_cclk), // 1-bit output: Clock output
.CE0(o_wr_cmd | o_rd_cmd), // 1-bit input: Clock enable input for I0
.CE1(1'b1), // 1-bit input: Clock enable input for I1
.I0(~i_cclk), // 1-bit input: Primary clock
.I1(~i_cclk), // 1-bit input: Secondary clock
.IGNORE0(1'b0), // 1-bit input: Clock ignore input for I0
.IGNORE1(1'b0), // 1-bit input: Clock ignore input for I1
.S0(1'b1), // 1-bit input: Clock select for I0
.S1(1'b0) // 1-bit input: Clock select for I1
);
BUFGCTRL #(
.INIT_OUT(1), // Initial value of BUFGCTRL output ($VALUES;)
.PRESELECT_I0("TRUE"), // BUFGCTRL output uses I0 input ($VALUES;)
.PRESELECT_I1("FALSE") // BUFGCTRL output uses I1 input ($VALUES;)
)
BUFGCTRL_inst (
.O(o_cclk), // 1-bit output: Clock output
.CE0(en), // 1-bit input: Clock enable input for I0
.CE1(1'b1), // 1-bit input: Clock enable input for I1
.I0(~i_cclk), // 1-bit input: Primary clock
.I1(~i_cclk), // 1-bit input: Secondary clock
.IGNORE0(1'b0), // 1-bit input: Clock ignore input for I0
.IGNORE1(1'b0), // 1-bit input: Clock ignore input for I1
.S0(1'b1), // 1-bit input: Clock select for I0
.S1(1'b0) // 1-bit input: Clock select for I1
);
新手不明白你说什么,你一条语句不是已经实现了吗。什么叫怎么实现。
你是要切换时钟?用的什么器件,xilinx的bufg都有切换时钟的功能
谢谢小编
额,应该用BUFGCE吧,呵呵,貌似搞错了
貌似自己会呀 这是在显摆吗 亲
亲,我昨天看了资料才会的,好不? 又没人帮我解惑。
是打算做门控时钟吗?
好东西
想做个取反的门控时钟
