verilog - 无法在 Lattice ICE40 FPGA 上创建时钟信号

标签 verilog fpga clock lattice ice40

我正在尝试在 Lattice ICE40 FPGA 上创建 1 Hz 时钟信号。我正在用 Verilog 编写代码并使用 Lattice Radiant 软件。该 1 Hz 时钟信号将用于创建方波。

但是,我没有得到任何输出,无论是从时钟信号应该打开的引脚还是从应该输出方波的引脚。我确信我正在检查正确的引脚。我也确信代码正在下载到板上。我相信由于某种原因 FPGA 实际上并未创建时钟信号。

这是我的代码:

module square (clk, x, y, z);

// Inputs and Outputs
input clk; // The clock signal
output x, y, z; // The square wave output

// Type Declaration
reg x; // x is a register

// Initialize x
initial
    begin
        x = 0;
    end

// Run each time the clock transitions from low to high
always @(posedge clk)
    begin 
        x = !x; // Flip x
    end

// Outputs used to confirm the program is running   
assign y = 0; //39A
assign z = 1; //41A

endmodule

这是我的综合约束文件 (.ldc):

create_clock -name {clk} -period 1000000000 [get_ports clk]

周期以纳秒为单位定义,因此这是一个 1 Hz 的时钟。

谢谢。

最佳答案

谢谢大家。我没有意识到我需要自己制作时钟。我使用高速振荡器功能创建了一个时钟:

// Initialize the high speed oscillator
HSOSC clock (
    .CLKHFEN(1'b1), // Enable the output  
    .CLKHFPU(1'b1), // Power up the oscillator  
    .CLKHF(clk) // Oscillator output  
);

// Divide the oscillator down to 6 MHz
defparam clock.CLKHF_DIV = "0b11";

它似乎正在发挥作用。

关于verilog - 无法在 Lattice ICE40 FPGA 上创建时钟信号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54312254/

相关文章:

c++ - 如何粗略计算和打印clock_t时间

verilog - 在verilog中包含一个模块

c++ - FPGA - 使用 C/C++ 测量 CPU 延迟

android - 是否可以开发一个时钟并使其始终显示在 android 设备的屏幕上?

fpga - FPGA如何 "Updated"

tdd - 在Verilog或VHDL中进行逻辑(芯片)设计的测试驱动开发(TDD)的经验

python - time.time() 在重复调用中漂移

Verilog(始终分配)

c - 如何编译和运行一个调用C函数的verilog程序?

filter - Verilog FIR 滤波器