当前是演示版本,不支持修改 CLB、IOB 数量,也不支持加载自行构建的 Bitstream。
完整版本支持修改 CLB、IOB 数量,支持修改网络短线、长线数量,包含完整工具链,支持编写 Verilog 生成仿真器支持的 Bitstream。
如需完整版本,请 联系我们。
鼠标移动到仿真器左下角可以看到隐藏的操作指南。
当前仿真的 Verilog 代码:
module toggle_led (
input wire clk, // 时钟输入
input wire rst, // 高电平有效同步复位
input wire sw, // 拨码开关输入
output wire led // LED 输出
);
reg q;
wire d = ~rst & (q ^ sw); // 组合逻辑
always @(posedge clk) // 时钟上升沿锁存
q <= d;
assign led = q; // 输出
endmodule约束文件(Verilog 版本):
# 时钟约束
set_property PACKAGE_PIN P15 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports clk]
# 按键 / 拨码开关
set_property PACKAGE_PIN T1 [get_ports rst]
set_property PACKAGE_PIN P4 [get_ports sw]
set_property IOSTANDARD LVCMOS33 [get_ports {rst sw}]
# LED(active low)
set_property PACKAGE_PIN F13 [get_ports led]
set_property IOSTANDARD LVCMOS33 [get_ports led]生成的 Bitstream 代码:
{
"name": "Toggle LED with Reset",
"fabric": { "cols": 4, "rows": 3, "short_tracks": 5, "long_tracks": 3 },
"clb_configs": [{
"col": 1, "row": 1, "lut_init": 5140, // LUT 真值表 = 0x1414
"ff_enabled": true, "clock_edge": "rising", // 使能触发器,上升沿
"output_select": "registered" // 输出取 FF 的 Q
}],
"iob_configs": [
{ "index": 9, "label": "RST" }, // IOB9 → 复位输入
{ "index": 8, "label": "SW" }, // IOB8 → 开关输入
{ "index": 12, "label": "LED" } // IOB12 → LED 输出
],
"cb_switches": [ ... ], // 连接块开关 — 将 IOB/CLB 连到布线通道
"sb_switches": [ ... ] // 交换块开关 — 决定通道之间如何互联
}与正常 FPGA 不同的是,提供了可供直接阅读的 JSON 格式作为仿真器的 Bitstream,更方便原理的学习。