我有一个用于 SPI 多路复用器的 Lattice Diamond 项目,它具有以下模块定义:
module spimux
(
input bmck,
input bssel,
input bmosi,
output bmiso,
input[3:0] a,
output[13:0] mck,
output[13:0] ssel,
output[13:0] mosi,
input[13:0] miso,
output reg[7:0] LED
);
OutputMux bmiso_mux (
.clk(osc_clk),
.out(bmiso),
.a(a),
.in(miso)
);
// the idea here is that on each rising clock edge, the module will take
// the 4-bit address a and then set *one* of the 14 bits in "in". One
// problem I see is that I don't prevent an invalid address of 0b1111 or
// 0b1110 from getting used.
module OutputMux
(
input clk,
output reg out,
input[3:0] a,
input[13:0] in
);
reg mask;
always @(posedge clk) begin
// I tried this and it didn't help my situation
//out <= (in & (14'b1 << a));
// so I tried to assign to a temp variable and then do the bitmasking.. no change.
mask = 14'b1 << a;
out <= (in[13:0] & mask);
end
endmodule
endmodule
当我进入电子表格视图分配我的引脚时,并非所有引脚都显示在信号名称下拉列表中。例如,它看起来像这样:
您会看到 miso[0] 在那里作为输入端口,但所有其他 13 个 miso 位都没有。此外,缺少 bmck、bssel 和 bmosi。他们还没有被分配到任何其他引脚,所以谁能解释为什么他们不会在那里?