FPGA project : flash_write

本文详细介绍了使用Flash的页编程指令PP进行编程的过程,涉及擦除操作、SPI模块的状态机设计以及相应的控制信号编码,展示了如何通过状态机来控制SPI传输数据和执行指令的过程。

本实验重点学习了:

flash的页编程指令pp。

在写之前要先进行擦除(全擦除和页擦除);

本实验:先传写指令,然后进入写锁存周期,然后传页编程指令,+3个地址;

然后传数据,奇数传55,偶数传aa。

在之前扇区擦除的代码上改改就行了。加一个功能就是传入数据大于256个时候,mosi一直拉高。

模块框图:

状态机:

代码:

只放spi模块的。因为其他代码和扇区擦除指令是一样的。

module spi (
    input       wire            sys_clk     ,
    input       wire            sys_rst_n   , 
    input       wire            key_start   ,

    output      wire            miso        ,
    output      reg             mosi        ,
    output      reg             cs_n        ,
    output      reg             sck 
);
    // parameter 
    parameter   COMD_W    = 8'h06    , // 写指令, 先发送写指令,进入写锁存周期
                COMD_P    = 8'h02    , // 页写指令
                MAX_NUM   = 32'd270  ; // 要发送指令+地址+数据的字节数。 2 + 3 + 100
    parameter   ADR_SE    = 8'h00    , // 扇区地址 adress secter
                ADR_PA    = 8'h04    , // 页地址   adress page
                ADR_BY    = 8'h00    ; // 字节地址 adress byte
    parameter   DATA_ODD  = 8'h55    , // odd  奇数
                DATA_EVE  = 8'haa    ; // even 偶数
    parameter   IDLE      = 5'b00001 ,
                WREN      = 5'b00010 ,
                WEL       = 5'b00100 ,
                INST      = 5'b01000 , // instruct 传送pp指令和addr
                DATA      = 5'b10000 ; // instruct 传送要写入的数据。
    // wire signal degine
    wire                IDLEtoWREN; 
    wire                WRENtoWEL ;  
    wire                WRENtoINST;   
    wire                INSTtoDATA;   
    wire                DATAtoIDLE;   
    // reg signal define
    reg     [19:0]      data_num  ; // 记录传递的数据,如果超过256个,那么mosi将会一直拉高(传1).
    reg     [4:0]       state_c   ;
    reg     [4:0]       state_n   ;
    reg     [3:0]       cnt_20ns  ;
    reg     [3:0]       cnt_bit   ;
    reg     [31:0]      cnt_byte  ;
    reg                 flag_bit  ;
    reg                 f_b_reg   ; // flag_bit_reg的缩写
/****************************************************************************/
    // 三段式状态机
    // 现态与次态描述
    // state_c
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n) 
            state_c <= IDLE ;
        else
            state_c <= state_n ;
    end
    // state_n
    always @(*) begin
        case (state_c)
        IDLE   :if(IDLEtoWREN)
                    state_n <= WREN ;
                else 
                    state_n <= IDLE ;
        WREN   :if(WRENtoWEL)
                    state_n <= WEL  ;
                else 
                    state_n <= WREN ;
        WEL    :if(WRENtoINST)
                    state_n <= INST ;
                else 
                    state_n <= WEL  ;
        INST   :if(INSTtoDATA)
                    state_n <= DATA ;
                else 
                    state_n <= INST ;
        DATA   :if(DATAtoIDLE)
                    state_n <= IDLE ;
                else 
                    state_n <= DATA ;
        default:    state_n <= IDLE ;
        endcase
    end
    // 状态转移描述
    assign  IDLEtoWREN  = ( state_c == IDLE) && ( key_start     ) ;
    assign  WRENtoWEL   = ( state_c == WREN) && ( f_b_reg       ) ;
    assign  WRENtoINST  = ( state_c == WEL ) && ( cnt_20ns == 6 ) ;
    assign  INSTtoDATA  = ( state_c == INST) && ( f_b_reg       ) ;
    assign  DATAtoIDLE  = ( state_c == DATA) && ( f_b_reg && cnt_byte != 5) ; // 至少传递一个数据。否则会卡死在这个状态。
    // 相关信号描述
    // reg     [3:0]       cnt_20ns  ;
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n) 
            cnt_20ns <= 4'd0 ;
        else 
        case (state_c)
        IDLE :  cnt_20ns <= 4'd0 ;
        WREN :  if(cnt_20ns || f_b_reg)
                    cnt_20ns <= 4'd0 ;
                else 
                    cnt_20ns <= cnt_20ns + 1'b1 ;
        WEL  :  if(cnt_20ns == 6) // 60x20ns==120ns
                    cnt_20ns <= 4'd0 ;
                else
                    cnt_20ns <= cnt_20ns + 1'b1 ;
        INST :  if(cnt_20ns) // 由于下一个状态是发送数据,sck和cnt_20_ns的变换规律与INST相同。所以不需要f_b_reg。
                    cnt_20ns <= 4'd0 ;
                else 
                    cnt_20ns <= cnt_20ns + 1'b1 ;
        DATA :  if(cnt_20ns || (f_b_reg && cnt_byte != 5))
                    cnt_20ns <= 4'd0 ;
                else 
                    cnt_20ns <= cnt_20ns + 1'b1 ;
        default:    cnt_20ns <= 4'd0 ;
        endcase
    end
    // reg     [3:0]       cnt_bit   ;
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n)
            cnt_bit <= 4'd0 ;
        else 
        case (state_c)
        IDLE :  cnt_bit <= 4'd0 ;
        WREN :  if(!cnt_20ns && sck && cnt_bit == 7)
                    cnt_bit <= 4'd0 ;
                else if(!cnt_20ns && sck)
                    cnt_bit <= cnt_bit + 1'b1 ;
        WEL  :  cnt_bit <= 4'd0 ;
        INST :  if(!cnt_20ns && sck && cnt_bit == 7)
                    cnt_bit <= 4'd0 ;
                else if(!cnt_20ns && sck)
                    cnt_bit <= cnt_bit + 1'b1 ;
        DATA :  if(!cnt_20ns && sck && cnt_bit == 7)
                    cnt_bit <= 4'd0 ;
                else if(!cnt_20ns && sck)
                    cnt_bit <= cnt_bit + 1'b1 ;
        default:    cnt_bit <= 4'd0 ;
        endcase
    end
    // reg      [31:0]       cnt_byte
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n) 
            cnt_byte <= 32'd0 ;
        else if(cnt_bit == 7 && !cnt_20ns && sck && cnt_byte == MAX_NUM - 1) // 计数到传送字节的最大值。
            cnt_byte <= 32'd0 ;
        else if(cnt_bit == 7 && !cnt_20ns && sck)
            cnt_byte <= cnt_byte + 1'b1 ;
        else 
            cnt_byte <= cnt_byte ;
    end
    // reg                 flag_bit  ;
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n) 
            flag_bit <= 1'b0 ;
        else
        case (state_c)
        IDLE :  flag_bit <= 1'b0 ;
        WREN :  if(cnt_bit == 7 && sck && !cnt_20ns)
                    flag_bit <= 1'b1 ;
                else 
                    flag_bit <= flag_bit ;
        WEL  :  flag_bit <= 1'b0 ;
        INST :  if(cnt_bit == 7 && sck && !cnt_20ns && cnt_byte == 4)
                    flag_bit <= 1'b1 ;
                else 
                    flag_bit <= flag_bit ;
        DATA :  if(cnt_bit == 0 && cnt_byte == 5)
                    flag_bit <= 1'b0 ;
                else if(cnt_bit == 7 && sck && !cnt_20ns && cnt_byte == MAX_NUM - 1)
                    flag_bit <= 1'b1 ;
                else 
                    flag_bit <= flag_bit ;
        default: flag_bit <= 1'b0 ;
        endcase
    end
    // reg                 f_b_reg   ;
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n) begin
            f_b_reg <= 1'b0 ;
        end else begin
            f_b_reg <= flag_bit ;
        end
    end
    // reg  [19:0]   data_num
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n)
            data_num <= 20'd0 ;
        else if(state_c == DATA && cnt_bit == 7 && !cnt_20ns && sck)
            data_num <= data_num + 1'b1 ;
        else if(state_c != DATA)
            data_num <= 20'd0 ;
        else 
            data_num <= data_num ;
    end
    // output signal
    // wire            miso        ,
    assign miso = 1'bz ;
    // mosi
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n)
            mosi <= 1'b0 ;
        else
        case (state_c)
        IDLE :  mosi <= 1'b0 ;
        WREN :  if(!cnt_bit) // (cnt_bit == 0)
                    mosi <= COMD_W[7] ;
                else if(cnt_20ns && sck)
                    mosi <= COMD_W[7 - cnt_bit] ;
                else 
                    mosi <= mosi ;
        WEL  :  mosi <= 1'b0 ;
        INST :  case (cnt_byte)
                    1:  
                        begin
                            if(!cnt_bit)
                                mosi <= COMD_P[7] ;
                            else if(cnt_20ns && sck)
                                mosi <= COMD_P[7 - cnt_bit] ;
                            else 
                                mosi <= mosi ;  
                        end
                    2:  
                        begin
                            if(!cnt_bit)
                                mosi <= ADR_SE[7] ;
                            else if(cnt_20ns && sck)
                                mosi <= ADR_SE[7 - cnt_bit] ;
                            else 
                                mosi <= mosi ;  
                        end
                    3:  
                        begin
                            if(!cnt_bit)
                                mosi <= ADR_PA[7] ;
                            else if(cnt_20ns && sck)
                                mosi <= ADR_PA[7 - cnt_bit] ;
                            else 
                                mosi <= mosi ;  
                        end
                    4:  
                        begin
                            if(!cnt_bit)
                                mosi <= ADR_BY[7] ;
                            else if(cnt_20ns && sck)
                                mosi <= ADR_BY[7 - cnt_bit] ;
                            else 
                                mosi <= mosi ;  
                        end
                    5:  
                        begin
                            if(!cnt_bit) // 由于当cnt_byte == 5 时,有一段state_c没有立即跳转到data状态。
                                mosi <= DATA_ODD[7] ;
                            else if(cnt_20ns && sck)
                                mosi <= DATA_ODD[7 - cnt_bit] ;
                            else 
                                mosi <= mosi ;  
                        end
                default:        mosi <= 1'b0 ;
                endcase
        DATA :  if(data_num <= 255) begin
                    if(cnt_byte[0]) begin // 二进制最低为奇偶标志位,1表示奇位,发送数据5。
                        if(!cnt_bit)
                            mosi <= DATA_ODD[7] ;
                        else if(cnt_20ns && sck)
                            mosi <= DATA_ODD[7 - cnt_bit] ;
                        else 
                            mosi <= mosi ;  
                    end else begin // cnt_byte[0] == 0 偶数。发送数据a
                        if(!cnt_bit)
                            mosi <= DATA_EVE[7] ;
                        else if(cnt_20ns && sck)
                            mosi <= DATA_EVE[7 - cnt_bit] ;
                        else 
                            mosi <= mosi ;  
                    end
        end else begin
            mosi <= 1'b1 ; // 大于256个数据之后,mosi就一直传递1.
        end
        default:    mosi <= 1'b0 ;
        endcase
    end
    // reg             cs_n        ,
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n) begin
            cs_n <= 1'b1 ;
        end else begin
            case (state_c)
            IDLE :  if(key_start)
                        cs_n <= 1'b0 ;
                    else 
                        cs_n <= 1'b1 ;
            WREN :  if(f_b_reg)
                        cs_n <= 1'b1 ;
                    else 
                        cs_n <= cs_n ;
            WEL  :  if(cnt_20ns == 6) 
                        cs_n <= 1'b0 ;
                    else 
                        cs_n <= cs_n ;
            INST :  cs_n <= 1'b0 ;
            DATA :  if(f_b_reg && cnt_byte != 5 )
                        cs_n <= 1'b1 ;
                    else 
                        cs_n <= cs_n ;
            default:    cs_n <= 1'b1 ;
            endcase
        end
    end
    // reg             sck 
    always @(posedge sys_clk or negedge sys_rst_n) begin
        if(~sys_rst_n)
            sck <= 1'b0 ;
        else 
        case (state_c)
        IDLE :  sck <= 1'b0 ;
        WREN :  if(cnt_20ns)
                    sck <= ~sck ;
                else 
                    sck <= sck  ;
        WEL  :  sck <= 1'b0 ;
        INST :  if(cnt_20ns)
                    sck <= ~sck ;
                else 
                    sck <= sck  ;
        DATA :  if(cnt_20ns)
                    sck <= ~sck ;
                else 
                    sck <= sck  ;
        default:    sck <= 1'b0 ;
        endcase
    end

endmodule

仿真波形: 

 

 

分析CPLD程序编译不通过对原因并解决:Info: ******************************************************************* Info: Running Quartus Prime Analysis & Synthesis Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:26 2025 Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:26 2025 Info: Command: quartus_map --read_settings_files=on --write_settings_files=off i2cfpga -c i2cfpga Info (16303): High Performance Effort optimization mode selected -- timing performance will be prioritized at the potential cost of increased compilation time Info (20032): Parallel compilation is enabled and will use up to 4 processors Info (12021): Found 1 design units, including 1 entities, in source file src/sim/wb_master_model.v Info (12023): Found entity 1: wb_master_model Info (12023): Found entity 1: wb_master_model Info (12021): Found 1 design units, including 1 entities, in source file src/sim/tst_bench_top.v Info (12023): Found entity 1: tst_bench_top Info (12023): Found entity 1: tst_bench_top Info (12021): Found 0 design units, including 0 entities, in source file src/sim/timescale.v Info (12021): Found 1 design units, including 1 entities, in source file src/sim/i2c_master_top.v Info (12023): Found entity 1: i2c_master_top Info (12023): Found entity 1: i2c_master_top Info (12021): Found 0 design units, including 0 entities, in source file src/sim/i2c_master_defines.v Info (12021): Found 1 design units, including 1 entities, in source file src/sim/i2c_master_byte_ctrl.v Info (12023): Found entity 1: i2c_master_byte_ctrl Info (12023): Found entity 1: i2c_master_byte_ctrl Info (12021): Found 1 design units, including 1 entities, in source file src/sim/i2c_master_bit_ctrl.v Info (12023): Found entity 1: i2c_master_bit_ctrl Info (12023): Found entity 1: i2c_master_bit_ctrl Info (15248): File "C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/src/timescale.v" is a duplicate of already analyzed file "C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/src/sim/timescale.v" (same filename, same library name and same md5 digest). Skipping analysis of this file. Info (12021): Found 0 design units, including 0 entities, in source file src/timescale.v Info (12021): Found 1 design units, including 1 entities, in source file src/myram.v Info (12023): Found entity 1: myRAM Info (12023): Found entity 1: myRAM Info (12021): Found 1 design units, including 1 entities, in source file src/i2cslave.v Info (12023): Found entity 1: I2Cslave Info (12023): Found entity 1: I2Cslave Info (15248): File "C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/timescale.v" is a duplicate of already analyzed file "C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/src/sim/timescale.v" (same filename, same library name and same md5 digest). Skipping analysis of this file. Info (12021): Found 0 design units, including 0 entities, in source file timescale.v Info (12021): Found 1 design units, including 1 entities, in source file pulse_reg_top.v Info (12023): Found entity 1: pulse_reg_top Info (12023): Found entity 1: pulse_reg_top Info (12021): Found 1 design units, including 1 entities, in source file pulse_reg_gen4.v Info (12023): Found entity 1: pulse_reg_gen4 Info (12023): Found entity 1: pulse_reg_gen4 Info (12021): Found 1 design units, including 1 entities, in source file pulse_reg.v Info (12023): Found entity 1: pulse_reg Info (12023): Found entity 1: pulse_reg Info (12021): Found 1 design units, including 1 entities, in source file pll4x.v Info (12023): Found entity 1: pll4x Info (12023): Found entity 1: pll4x Info (12127): Elaborating entity "pulse_reg_top" for the top level hierarchy Info (12128): Elaborating entity "I2Cslave" for hierarchy "I2Cslave:I2Cslave_inst" Info (12128): Elaborating entity "pulse_reg" for hierarchy "pulse_reg:pulse_reg_inst" Info (12128): Elaborating entity "pulse_reg_gen4" for hierarchy "pulse_reg_gen4:pulse_reg_gen4_inst" Info (12128): Elaborating entity "pll4x" for hierarchy "pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x" Info (12128): Elaborating entity "altpll" for hierarchy "pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component" Info (12130): Elaborated megafunction instantiation "pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component" Info (12133): Instantiated megafunction "pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component" with the following parameter: Info (12134): Parameter "bandwidth_type" = "AUTO" Info (12134): Parameter "clk0_divide_by" = "1" Info (12134): Parameter "clk0_duty_cycle" = "50" Info (12134): Parameter "clk0_multiply_by" = "4" Info (12134): Parameter "clk0_phase_shift" = "0" Info (12134): Parameter "clk1_divide_by" = "1" Info (12134): Parameter "clk1_duty_cycle" = "50" Info (12134): Parameter "clk1_multiply_by" = "4" Info (12134): Parameter "clk1_phase_shift" = "2500" Info (12134): Parameter "compensate_clock" = "CLK0" Info (12134): Parameter "inclk0_input_frequency" = "20000" Info (12134): Parameter "intended_device_family" = "Cyclone IV E" Info (12134): Parameter "lpm_hint" = "CBX_MODULE_PREFIX=pll4x" Info (12134): Parameter "lpm_type" = "altpll" Info (12134): Parameter "operation_mode" = "NORMAL" Info (12134): Parameter "pll_type" = "AUTO" Info (12134): Parameter "port_activeclock" = "PORT_UNUSED" Info (12134): Parameter "port_areset" = "PORT_UNUSED" Info (12134): Parameter "port_clkbad0" = "PORT_UNUSED" Info (12134): Parameter "port_clkbad1" = "PORT_UNUSED" Info (12134): Parameter "port_clkloss" = "PORT_UNUSED" Info (12134): Parameter "port_clkswitch" = "PORT_UNUSED" Info (12134): Parameter "port_configupdate" = "PORT_UNUSED" Info (12134): Parameter "port_fbin" = "PORT_UNUSED" Info (12134): Parameter "port_inclk0" = "PORT_USED" Info (12134): Parameter "port_inclk1" = "PORT_UNUSED" Info (12134): Parameter "port_locked" = "PORT_USED" Info (12134): Parameter "port_pfdena" = "PORT_UNUSED" Info (12134): Parameter "port_phasecounterselect" = "PORT_UNUSED" Info (12134): Parameter "port_phasedone" = "PORT_UNUSED" Info (12134): Parameter "port_phasestep" = "PORT_UNUSED" Info (12134): Parameter "port_phaseupdown" = "PORT_UNUSED" Info (12134): Parameter "port_pllena" = "PORT_UNUSED" Info (12134): Parameter "port_scanaclr" = "PORT_UNUSED" Info (12134): Parameter "port_scanclk" = "PORT_UNUSED" Info (12134): Parameter "port_scanclkena" = "PORT_UNUSED" Info (12134): Parameter "port_scandata" = "PORT_UNUSED" Info (12134): Parameter "port_scandataout" = "PORT_UNUSED" Info (12134): Parameter "port_scandone" = "PORT_UNUSED" Info (12134): Parameter "port_scanread" = "PORT_UNUSED" Info (12134): Parameter "port_scanwrite" = "PORT_UNUSED" Info (12134): Parameter "port_clk0" = "PORT_USED" Info (12134): Parameter "port_clk1" = "PORT_USED" Info (12134): Parameter "port_clk2" = "PORT_UNUSED" Info (12134): Parameter "port_clk3" = "PORT_UNUSED" Info (12134): Parameter "port_clk4" = "PORT_UNUSED" Info (12134): Parameter "port_clk5" = "PORT_UNUSED" Info (12134): Parameter "port_clkena0" = "PORT_UNUSED" Info (12134): Parameter "port_clkena1" = "PORT_UNUSED" Info (12134): Parameter "port_clkena2" = "PORT_UNUSED" Info (12134): Parameter "port_clkena3" = "PORT_UNUSED" Info (12134): Parameter "port_clkena4" = "PORT_UNUSED" Info (12134): Parameter "port_clkena5" = "PORT_UNUSED" Info (12134): Parameter "port_extclk0" = "PORT_UNUSED" Info (12134): Parameter "port_extclk1" = "PORT_UNUSED" Info (12134): Parameter "port_extclk2" = "PORT_UNUSED" Info (12134): Parameter "port_extclk3" = "PORT_UNUSED" Info (12134): Parameter "self_reset_on_loss_lock" = "OFF" Info (12134): Parameter "width_clock" = "5" Info (12134): Parameter "bandwidth_type" = "AUTO" Info (12134): Parameter "clk0_divide_by" = "1" Info (12134): Parameter "clk0_duty_cycle" = "50" Info (12134): Parameter "clk0_multiply_by" = "4" Info (12134): Parameter "clk0_phase_shift" = "0" Info (12134): Parameter "clk1_divide_by" = "1" Info (12134): Parameter "clk1_duty_cycle" = "50" Info (12134): Parameter "clk1_multiply_by" = "4" Info (12134): Parameter "clk1_phase_shift" = "2500" Info (12134): Parameter "compensate_clock" = "CLK0" Info (12134): Parameter "inclk0_input_frequency" = "20000" Info (12134): Parameter "intended_device_family" = "Cyclone IV E" Info (12134): Parameter "lpm_hint" = "CBX_MODULE_PREFIX=pll4x" Info (12134): Parameter "lpm_type" = "altpll" Info (12134): Parameter "operation_mode" = "NORMAL" Info (12134): Parameter "pll_type" = "AUTO" Info (12134): Parameter "port_activeclock" = "PORT_UNUSED" Info (12134): Parameter "port_areset" = "PORT_UNUSED" Info (12134): Parameter "port_clkbad0" = "PORT_UNUSED" Info (12134): Parameter "port_clkbad1" = "PORT_UNUSED" Info (12134): Parameter "port_clkloss" = "PORT_UNUSED" Info (12134): Parameter "port_clkswitch" = "PORT_UNUSED" Info (12134): Parameter "port_configupdate" = "PORT_UNUSED" Info (12134): Parameter "port_fbin" = "PORT_UNUSED" Info (12134): Parameter "port_inclk0" = "PORT_USED" Info (12134): Parameter "port_inclk1" = "PORT_UNUSED" Info (12134): Parameter "port_locked" = "PORT_USED" Info (12134): Parameter "port_pfdena" = "PORT_UNUSED" Info (12134): Parameter "port_phasecounterselect" = "PORT_UNUSED" Info (12134): Parameter "port_phasedone" = "PORT_UNUSED" Info (12134): Parameter "port_phasestep" = "PORT_UNUSED" Info (12134): Parameter "port_phaseupdown" = "PORT_UNUSED" Info (12134): Parameter "port_pllena" = "PORT_UNUSED" Info (12134): Parameter "port_scanaclr" = "PORT_UNUSED" Info (12134): Parameter "port_scanclk" = "PORT_UNUSED" Info (12134): Parameter "port_scanclkena" = "PORT_UNUSED" Info (12134): Parameter "port_scandata" = "PORT_UNUSED" Info (12134): Parameter "port_scandataout" = "PORT_UNUSED" Info (12134): Parameter "port_scandone" = "PORT_UNUSED" Info (12134): Parameter "port_scanread" = "PORT_UNUSED" Info (12134): Parameter "port_scanwrite" = "PORT_UNUSED" Info (12134): Parameter "port_clk0" = "PORT_USED" Info (12134): Parameter "port_clk1" = "PORT_USED" Info (12134): Parameter "port_clk2" = "PORT_UNUSED" Info (12134): Parameter "port_clk3" = "PORT_UNUSED" Info (12134): Parameter "port_clk4" = "PORT_UNUSED" Info (12134): Parameter "port_clk5" = "PORT_UNUSED" Info (12134): Parameter "port_clkena0" = "PORT_UNUSED" Info (12134): Parameter "port_clkena1" = "PORT_UNUSED" Info (12134): Parameter "port_clkena2" = "PORT_UNUSED" Info (12134): Parameter "port_clkena3" = "PORT_UNUSED" Info (12134): Parameter "port_clkena4" = "PORT_UNUSED" Info (12134): Parameter "port_clkena5" = "PORT_UNUSED" Info (12134): Parameter "port_extclk0" = "PORT_UNUSED" Info (12134): Parameter "port_extclk1" = "PORT_UNUSED" Info (12134): Parameter "port_extclk2" = "PORT_UNUSED" Info (12134): Parameter "port_extclk3" = "PORT_UNUSED" Info (12134): Parameter "self_reset_on_loss_lock" = "OFF" Info (12134): Parameter "width_clock" = "5" Info (12021): Found 1 design units, including 1 entities, in source file db/pll4x_altpll.v Info (12023): Found entity 1: pll4x_altpll Info (12023): Found entity 1: pll4x_altpll Info (12128): Elaborating entity "pll4x_altpll" for hierarchy "pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated" Info (13000): Registers with preset signals will power-up high Info (13003): DEV_CLRn pin will set, and not reset, register with preset signal due to NOT Gate Push-Back Info (286030): Timing-Driven Synthesis is running Info (17049): 3 registers lost all their fanouts during netlist optimizations. Info (128000): Starting physical synthesis optimizations for speed Info (332104): Reading SDC File: 'I2Cslave.sdc' Info (332110): Deriving PLL clocks Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -phase 180.00 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -phase 180.00 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} Info (332151): Clock uncertainty is not calculated until you update the timing netlist. Info (332154): The derive_clock_uncertainty command did not apply clock uncertainty to any clock-to-clock transfers. Info (332129): Detected timing requirements -- optimizing circuit to achieve only the specified requirements Info (332111): Found 3 clocks Info (332111): Period Clock Name Info (332111): ======== ============ Info (332111): 20.000 clk Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332111): Period Clock Name Info (332111): ======== ============ Info (332111): 20.000 clk Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (128002): Starting physical synthesis algorithm register retiming Info (128003): Physical synthesis algorithm register retiming complete: estimated slack improvement of 1243 ps Info (128002): Starting physical synthesis algorithm combinational resynthesis using boolean division Info (128003): Physical synthesis algorithm combinational resynthesis using boolean division complete: estimated slack improvement of 0 ps Info (128001): Physical synthesis optimizations for speed complete: elapsed time is 00:00:01 Info (144001): Generated suppressed messages file C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/output_files/i2cfpga.map.smsg Info (16010): Generating hard_block partition "hard_block:auto_generated_inst" Info (16011): Adding 1 node(s), including 0 DDIO, 1 PLL, 0 transceiver and 0 LCELL Info (16011): Adding 1 node(s), including 0 DDIO, 1 PLL, 0 transceiver and 0 LCELL Info (21057): Implemented 1035 device resources after synthesis - the final resource count might be different Info (21058): Implemented 5 input pins Info (21059): Implemented 11 output pins Info (21060): Implemented 1 bidirectional pins Info (21061): Implemented 1017 logic cells Info (21065): Implemented 1 PLLs Info (21058): Implemented 5 input pins Info (21059): Implemented 11 output pins Info (21060): Implemented 1 bidirectional pins Info (21061): Implemented 1017 logic cells Info (21065): Implemented 1 PLLs Info: Quartus Prime Analysis & Synthesis was successful. 0 errors, 0 warnings Info: Peak virtual memory: 4846 megabytes Info: Processing ended: Mon Sep 15 13:40:36 2025 Info: Elapsed time: 00:00:10 Info: Total CPU time (on all processors): 00:00:09 Info: Peak virtual memory: 4846 megabytes Info: Processing ended: Mon Sep 15 13:40:36 2025 Info: Elapsed time: 00:00:10 Info: Total CPU time (on all processors): 00:00:09 Info: ******************************************************************* Info: Running Quartus Prime Fitter Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:37 2025 Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:37 2025 Info: Command: quartus_fit --read_settings_files=off --write_settings_files=off i2cfpga -c i2cfpga Info: qfit2_default_script.tcl version: #1 Info: Project = i2cfpga Info: Revision = i2cfpga Info (16303): High Performance Effort optimization mode selected -- timing performance will be prioritized at the potential cost of increased compilation time Info (20032): Parallel compilation is enabled and will use up to 4 processors Info (119006): Selected device EP4CE6F17C8 for design "i2cfpga" Info (21077): Low junction temperature is 0 degrees C Info (21077): High junction temperature is 85 degrees C Info (15535): Implemented PLL "pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated|pll1" as Cyclone IV E PLL type Info (15099): Implementing clock multiplication of 4, clock division of 1, and phase shift of 0 degrees (0 ps) for pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated|wire_pll1_clk[0] port Info (15099): Implementing clock multiplication of 4, clock division of 1, and phase shift of 180 degrees (2500 ps) for pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated|wire_pll1_clk[1] port Info (15099): Implementing clock multiplication of 4, clock division of 1, and phase shift of 0 degrees (0 ps) for pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated|wire_pll1_clk[0] port Info (15099): Implementing clock multiplication of 4, clock division of 1, and phase shift of 180 degrees (2500 ps) for pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated|wire_pll1_clk[1] port Info (171004): Fitter is performing a Standard Fit compilation using maximum Fitter effort to optimize design performance Warning (292013): Feature LogicLock is only available with a valid subscription license. You can purchase a software subscription to gain full access to this feature. Info (176444): Device migration not selected. If you intend to use device migration later, you may need to change the pin assignments as they may be incompatible with other devices Info (176445): Device EP4CE10F17C8 is compatible Info (176445): Device EP4CE15F17C8 is compatible Info (176445): Device EP4CE22F17C8 is compatible Info (176445): Device EP4CE10F17C8 is compatible Info (176445): Device EP4CE15F17C8 is compatible Info (176445): Device EP4CE22F17C8 is compatible Info (169124): Fitter converted 5 user pins into dedicated programming pins Info (169125): Pin ~ALTERA_ASDO_DATA1~ is reserved at location C1 Info (169125): Pin ~ALTERA_FLASH_nCE_nCSO~ is reserved at location D2 Info (169125): Pin ~ALTERA_DCLK~ is reserved at location H1 Info (169125): Pin ~ALTERA_DATA0~ is reserved at location H2 Info (169125): Pin ~ALTERA_nCEO~ is reserved at location F16 Info (169125): Pin ~ALTERA_ASDO_DATA1~ is reserved at location C1 Info (169125): Pin ~ALTERA_FLASH_nCE_nCSO~ is reserved at location D2 Info (169125): Pin ~ALTERA_DCLK~ is reserved at location H1 Info (169125): Pin ~ALTERA_DATA0~ is reserved at location H2 Info (169125): Pin ~ALTERA_nCEO~ is reserved at location F16 Info (332104): Reading SDC File: 'I2Cslave.sdc' Info (332110): Deriving PLL clocks Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -phase 180.00 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -phase 180.00 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} Info (332151): Clock uncertainty is not calculated until you update the timing netlist. Info (332154): The derive_clock_uncertainty command did not apply clock uncertainty to any clock-to-clock transfers. Info (332129): Detected timing requirements -- optimizing circuit to achieve only the specified requirements Info (332111): Found 3 clocks Info (332111): Period Clock Name Info (332111): ======== ============ Info (332111): 20.000 clk Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332111): Period Clock Name Info (332111): ======== ============ Info (332111): 20.000 clk Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332111): 5.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (176353): Automatically promoted node clk~input (placed in PIN E1 (CLK1, DIFFCLK_0n)) Info (176355): Automatically promoted destinations to use location or clock signal Global Clock CLKCTRL_G2 Info (176355): Automatically promoted destinations to use location or clock signal Global Clock CLKCTRL_G2 Info (176353): Automatically promoted node pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated|wire_pll1_clk[0] (placed in counter C0 of PLL_1) Info (176355): Automatically promoted destinations to use location or clock signal Global Clock CLKCTRL_G3 Info (176355): Automatically promoted destinations to use location or clock signal Global Clock CLKCTRL_G3 Info (176353): Automatically promoted node pulse_reg_gen4:pulse_reg_gen4_inst|pll4x:pll4x|altpll:altpll_component|pll4x_altpll:auto_generated|wire_pll1_clk[1] (placed in counter C1 of PLL_1) Info (176355): Automatically promoted destinations to use location or clock signal Global Clock CLKCTRL_G4 Info (176355): Automatically promoted destinations to use location or clock signal Global Clock CLKCTRL_G4 Info (176353): Automatically promoted node comb~0 Info (176355): Automatically promoted destinations to use location or clock signal Global Clock Info (176356): Following destination nodes may be non-global or may not use global or regional clocks Info (176357): Destination node I2Cslave:I2Cslave_inst|sda_oe~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~2 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_update~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt[0]~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|ld~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt~3 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~4 Info (176357): Destination node pulse_reg:pulse_reg_inst|out[7]~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~5 Info (176358): Non-global destination nodes limited to 10 nodes Info (176355): Automatically promoted destinations to use location or clock signal Global Clock Info (176356): Following destination nodes may be non-global or may not use global or regional clocks Info (176357): Destination node I2Cslave:I2Cslave_inst|sda_oe~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~2 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_update~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt[0]~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|ld~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt~3 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~4 Info (176357): Destination node pulse_reg:pulse_reg_inst|out[7]~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~5 Info (176358): Non-global destination nodes limited to 10 nodes Info (176357): Destination node I2Cslave:I2Cslave_inst|sda_oe~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~2 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_update~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt[0]~1 Info (176357): Destination node I2Cslave:I2Cslave_inst|ld~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|bit_cnt~3 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~4 Info (176357): Destination node pulse_reg:pulse_reg_inst|out[7]~0 Info (176357): Destination node I2Cslave:I2Cslave_inst|mem_do~5 Info (176358): Non-global destination nodes limited to 10 nodes Info (176233): Starting register packing Info (176235): Finished register packing Extra Info (176219): No registers were packed into other blocks Extra Info (176219): No registers were packed into other blocks Info (128000): Starting physical synthesis optimizations for speed Info (128001): Physical synthesis optimizations for speed complete: elapsed time is 00:00:00 Info (171121): Fitter preparation operations ending: elapsed time is 00:00:02 Info (14896): Fitter has disabled Advanced Physical Optimization because it is not supported for the current family. Info (170189): Fitter placement preparation operations beginning Info (170190): Fitter placement preparation operations ending: elapsed time is 00:00:00 Info (170191): Fitter placement operations beginning Info (170137): Fitter placement was successful Info (170192): Fitter placement operations ending: elapsed time is 00:00:02 Info (170193): Fitter routing operations beginning Info (170195): Router estimated average interconnect usage is 1% of the available device resources Info (170196): Router estimated peak interconnect usage is 8% of the available device resources in the region that extends from location X0_Y0 to location X10_Y11 Info (170196): Router estimated peak interconnect usage is 8% of the available device resources in the region that extends from location X0_Y0 to location X10_Y11 Info (170194): Fitter routing operations ending: elapsed time is 00:00:02 Info (11888): Total time spent on timing analysis during the Fitter is 0.62 seconds. Info (334003): Started post-fitting delay annotation Info (334004): Delay annotation completed successfully Info (334003): Started post-fitting delay annotation Info (334004): Delay annotation completed successfully Info (11218): Fitter post-fit operations ending: elapsed time is 00:00:01 Warning (169177): 6 pins must meet Intel FPGA requirements for 3.3-, 3.0-, and 2.5-V interfaces. For more information, refer to AN 447: Interfacing Cyclone IV E Devices with 3.3/3.0/2.5-V LVTTL/LVCMOS I/O Systems. Info (169178): Pin sda uses I/O standard 3.3-V LVTTL at B6 Info (169178): Pin clk uses I/O standard 3.3-V LVTTL at E1 Info (169178): Pin start_gpio uses I/O standard 3.3-V LVTTL at A5 Info (169178): Pin gpio_rstn uses I/O standard 3.3-V LVTTL at B7 Info (169178): Pin scl uses I/O standard 3.3-V LVTTL at B5 Info (169178): Pin k2 uses I/O standard 3.3-V LVTTL at C16 Info (169178): Pin sda uses I/O standard 3.3-V LVTTL at B6 Info (169178): Pin clk uses I/O standard 3.3-V LVTTL at E1 Info (169178): Pin start_gpio uses I/O standard 3.3-V LVTTL at A5 Info (169178): Pin gpio_rstn uses I/O standard 3.3-V LVTTL at B7 Info (169178): Pin scl uses I/O standard 3.3-V LVTTL at B5 Info (169178): Pin k2 uses I/O standard 3.3-V LVTTL at C16 Info (144001): Generated suppressed messages file C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/output_files/i2cfpga.fit.smsg Info: Quartus Prime Fitter was successful. 0 errors, 2 warnings Info: Peak virtual memory: 5497 megabytes Info: Processing ended: Mon Sep 15 13:40:45 2025 Info: Elapsed time: 00:00:08 Info: Total CPU time (on all processors): 00:00:04 Info: Peak virtual memory: 5497 megabytes Info: Processing ended: Mon Sep 15 13:40:45 2025 Info: Elapsed time: 00:00:08 Info: Total CPU time (on all processors): 00:00:04 Info: ******************************************************************* Info: Running Quartus Prime Assembler Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:46 2025 Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:46 2025 Info: Command: quartus_asm --read_settings_files=off --write_settings_files=off i2cfpga -c i2cfpga Info (115031): Writing out detailed assembly data for power analysis Info (115030): Assembler is generating device programming files Info: Quartus Prime Assembler was successful. 0 errors, 0 warnings Info: Peak virtual memory: 4697 megabytes Info: Processing ended: Mon Sep 15 13:40:47 2025 Info: Elapsed time: 00:00:01 Info: Total CPU time (on all processors): 00:00:00 Info: Peak virtual memory: 4697 megabytes Info: Processing ended: Mon Sep 15 13:40:47 2025 Info: Elapsed time: 00:00:01 Info: Total CPU time (on all processors): 00:00:00 Info (293026): Skipped module Power Analyzer due to the assignment FLOW_ENABLE_POWER_ANALYZER Info: ******************************************************************* Info: Running Quartus Prime Timing Analyzer Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:48 2025 Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:48 2025 Info: Command: quartus_sta i2cfpga -c i2cfpga Info: qsta_default_script.tcl version: #1 Info (20032): Parallel compilation is enabled and will use up to 4 processors Info (21077): Low junction temperature is 0 degrees C Info (21077): High junction temperature is 85 degrees C Info (332104): Reading SDC File: 'I2Cslave.sdc' Info (332110): Deriving PLL clocks Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -phase 180.00 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0]} Info (332110): create_generated_clock -source {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|inclk[0]} -multiply_by 4 -phase 180.00 -duty_cycle 50.00 -name {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} {pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1]} Info (332151): Clock uncertainty is not calculated until you update the timing netlist. Info (332123): Deriving Clock Uncertainty. Please refer to report_sdc in the Timing Analyzer to see clock uncertainties. Info: Found TIMING_ANALYZER_REPORT_SCRIPT_INCLUDE_DEFAULT_ANALYSIS = ON Info: Analyzing Slow 1200mV 85C Model Info (332146): Worst-case setup slack is 0.075 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.075 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.143 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 13.520 0.000 clk Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.075 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.143 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 13.520 0.000 clk Info (332146): Worst-case hold slack is 0.432 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.432 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.452 0.000 clk Info (332119): 2.878 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.432 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.452 0.000 clk Info (332119): 2.878 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332140): No Recovery paths to report Info (332140): No Removal paths to report Info (332146): Worst-case minimum pulse width slack is 2.197 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 2.197 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 2.219 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 9.743 0.000 clk Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 2.197 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 2.219 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 9.743 0.000 clk Info (332114): Report Metastability: Found 39 synchronizer chains. Info (332114): The design MTBF is not calculated because there are no specified synchronizers in the design. Info (332114): Number of Synchronizer Chains Found: 39 Info (332114): Shortest Synchronizer Chain: 2 Registers Info (332114): Fraction of Chains for which MTBFs Could Not be Calculated: 1.000 Info (332114): Worst Case Available Settling Time: 2.884 ns Info (332114): Info (332114): The design MTBF is not calculated because there are no specified synchronizers in the design. Info (332114): Number of Synchronizer Chains Found: 39 Info (332114): Shortest Synchronizer Chain: 2 Registers Info (332114): Fraction of Chains for which MTBFs Could Not be Calculated: 1.000 Info (332114): Worst Case Available Settling Time: 2.884 ns Info (332114): Info: Analyzing Slow 1200mV 0C Model Info (334003): Started post-fitting delay annotation Info (334004): Delay annotation completed successfully Info (332123): Deriving Clock Uncertainty. Please refer to report_sdc in the Timing Analyzer to see clock uncertainties. Info (332146): Worst-case setup slack is 0.268 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.268 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 0.299 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 13.807 0.000 clk Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.268 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 0.299 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 13.807 0.000 clk Info (332146): Worst-case hold slack is 0.381 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.381 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.401 0.000 clk Info (332119): 2.861 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.381 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.401 0.000 clk Info (332119): 2.861 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332140): No Recovery paths to report Info (332140): No Removal paths to report Info (332146): Worst-case minimum pulse width slack is 2.169 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 2.169 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 2.216 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 9.753 0.000 clk Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 2.169 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 2.216 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 9.753 0.000 clk Info (332114): Report Metastability: Found 39 synchronizer chains. Info (332114): The design MTBF is not calculated because there are no specified synchronizers in the design. Info (332114): Number of Synchronizer Chains Found: 39 Info (332114): Shortest Synchronizer Chain: 2 Registers Info (332114): Fraction of Chains for which MTBFs Could Not be Calculated: 1.000 Info (332114): Worst Case Available Settling Time: 3.209 ns Info (332114): Info (332114): The design MTBF is not calculated because there are no specified synchronizers in the design. Info (332114): Number of Synchronizer Chains Found: 39 Info (332114): Shortest Synchronizer Chain: 2 Registers Info (332114): Fraction of Chains for which MTBFs Could Not be Calculated: 1.000 Info (332114): Worst Case Available Settling Time: 3.209 ns Info (332114): Info: Analyzing Fast 1200mV 0C Model Info (332123): Deriving Clock Uncertainty. Please refer to report_sdc in the Timing Analyzer to see clock uncertainties. Info (332146): Worst-case setup slack is 1.429 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 1.429 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 2.917 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 17.182 0.000 clk Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 1.429 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 2.917 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 17.182 0.000 clk Info (332146): Worst-case hold slack is 0.178 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.178 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.186 0.000 clk Info (332119): 2.623 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 0.178 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 0.186 0.000 clk Info (332119): 2.623 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332140): No Recovery paths to report Info (332140): No Removal paths to report Info (332146): Worst-case minimum pulse width slack is 2.269 Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 2.269 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 2.297 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 9.263 0.000 clk Info (332119): Slack End Point TNS Clock Info (332119): ========= =================== ===================== Info (332119): 2.269 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[0] Info (332119): 2.297 0.000 pulse_reg_gen4_inst|pll4x|altpll_component|auto_generated|pll1|clk[1] Info (332119): 9.263 0.000 clk Info (332114): Report Metastability: Found 39 synchronizer chains. Info (332114): The design MTBF is not calculated because there are no specified synchronizers in the design. Info (332114): Number of Synchronizer Chains Found: 39 Info (332114): Shortest Synchronizer Chain: 2 Registers Info (332114): Fraction of Chains for which MTBFs Could Not be Calculated: 1.000 Info (332114): Worst Case Available Settling Time: 6.935 ns Info (332114): Info (332114): The design MTBF is not calculated because there are no specified synchronizers in the design. Info (332114): Number of Synchronizer Chains Found: 39 Info (332114): Shortest Synchronizer Chain: 2 Registers Info (332114): Fraction of Chains for which MTBFs Could Not be Calculated: 1.000 Info (332114): Worst Case Available Settling Time: 6.935 ns Info (332114): Info (332101): Design is fully constrained for setup requirements Info (332101): Design is fully constrained for hold requirements Info: Quartus Prime Timing Analyzer was successful. 0 errors, 0 warnings Info: Peak virtual memory: 4770 megabytes Info: Processing ended: Mon Sep 15 13:40:50 2025 Info: Elapsed time: 00:00:02 Info: Total CPU time (on all processors): 00:00:01 Info: Peak virtual memory: 4770 megabytes Info: Processing ended: Mon Sep 15 13:40:50 2025 Info: Elapsed time: 00:00:02 Info: Total CPU time (on all processors): 00:00:01 Info: ******************************************************************* Info: Running Quartus Prime EDA Netlist Writer Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:51 2025 Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:51 2025 Info: Command: quartus_eda --read_settings_files=off --write_settings_files=off i2cfpga -c i2cfpga Info (204019): Generated file i2cfpga.vo in folder "C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/simulation/questa/" for EDA simulation tool Info: Quartus Prime EDA Netlist Writer was successful. 0 errors, 0 warnings Info: Peak virtual memory: 4641 megabytes Info: Processing ended: Mon Sep 15 13:40:51 2025 Info: Elapsed time: 00:00:00 Info: Total CPU time (on all processors): 00:00:00 Info: Peak virtual memory: 4641 megabytes Info: Processing ended: Mon Sep 15 13:40:51 2025 Info: Elapsed time: 00:00:00 Info: Total CPU time (on all processors): 00:00:00 Info: ******************************************************************* Info: Running Quartus Prime Shell Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:52 2025 Info: Version 23.1std.1 Build 993 05/14/2024 SC Lite Edition Info: Processing started: Mon Sep 15 13:40:52 2025 Info: Command: quartus_sh -t e:/intelfpga_lite/23.1std/quartus/common/tcl/internal/nativelink/qnativesim.tcl --block_on_gui i2cfpga i2cfpga Info: Quartus(args): --block_on_gui i2cfpga i2cfpga Info: Info: Start Nativelink Simulation process Info: Info: Starting NativeLink simulation with Questa Intel FPGA software Info: Info: Generated Questa Intel FPGA script file C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/simulation/questa/i2cfpga_run_msim_gate_verilog.do Error: Error: Can't launch Questa Intel FPGA Simulation software -- make sure the software is properly installed and the environment variable LM_LICENSE_FILE or MGLS_LICENSE_FILE points to the correct license file. Error: Error: NativeLink simulation flow was NOT successful Info: Info: For messages from NativeLink scripts, check the file C:/Users/YG/Desktop/i2ccpld_20250729/i2ccpld_20250729/i2cfpga0421_restored/i2cfpga_nativelink_simulation.rpt Error (23031): Evaluation of Tcl script e:/intelfpga_lite/23.1std/quartus/common/tcl/internal/nativelink/qnativesim.tcl unsuccessful Error: Quartus Prime Shell was unsuccessful. 4 errors, 0 warnings Error: Peak virtual memory: 4744 megabytes Error: Processing ended: Mon Sep 15 13:40:56 2025 Error: Elapsed time: 00:00:04 Error: Total CPU time (on all processors): 00:00:00 Error: Peak virtual memory: 4744 megabytes Error: Processing ended: Mon Sep 15 13:40:56 2025 Error: Elapsed time: 00:00:04 Error: Total CPU time (on all processors): 00:00:00 Error (293001): Quartus Prime Full Compilation was unsuccessful. 5 errors, 2 warnings
09-16
<think> 我们正在解决Quartus Prime编译CPLD程序时NativeLink仿真流程失败的问题,具体问题是无法启动Questa Intel FPGA仿真软件,提示需要确保软件正确安装且环境变量(LM_LICENSE_FILE或MGLS_LICENSE_FILE)指向正确的许可证文件。 根据引用[3]中提到:需要勾选Questa-Intel FPGA Starter Edition,并申请免费许可(有些许复杂)。同时,引用[4]提到了ModelSim-Intel FPGA的仿真,但请注意,Questa Intel FPGA Edition是ModelSim的高级版本,但Starter版是免费的。 解决步骤: 1. 确认安装:首先确保在安装Quartus Prime时已经安装了Questa-Intel FPGA Starter Edition(在安装组件中勾选)。引用[3]提到,在安装过程中需要选择需要的Devices,并勾选Questa-Intel FPGA Starter Edition。如果没有安装,需要重新运行安装程序并添加此组件。 2. 许可证设置:引用[3]提到Starter版需要申请免费许可。因此,我们需要申请免费许可证并正确设置环境变量。 具体操作: a. 申请免费许可证:访问Intel FPGA官方网站,找到Questa-Intel FPGA Starter Edition的许可证申请页面,按照步骤申请(通常需要提供网卡MAC地址等信息)。申请成功后,会收到一个许可证文件(通常是.dat文件)。 b. 设置环境变量:将许可证文件存放在一个不含中文和空格的路径下,然后设置环境变量LM_LICENSE_FILE或MGLS_LICENSE_FILE指向该许可证文件。例如,如果许可证文件在`C:\licenses\questa_license.dat`,则设置环境变量值为`C:\licenses\questa_license.dat`。 3. 在Quartus Prime中设置仿真工具: 打开Quartus Prime,进入Tools -> Options -> EDA Tool Options。在右侧的Tool列表中,选择ModelSim(因为Questa Intel FPGA Edition在Quartus中通常被识别为ModelSim),然后在Tool location中指定Questa安装目录下的win32或win64目录(例如:`C:\intelFPGA\20.1\questa_fse\win64`)。注意:Quartus Prime 20.1及以后版本,Questa的安装路径可能在Quartus安装目录下的`questa_fse`文件夹。 4. 在工程中指定仿真工具: 在Assignment菜单下,选择Settings,然后在左侧选择Simulation。在右侧的Tool name中选择Questa Intel FPGA(或ModelSim)。同时,确保设置了正确的仿真模式(如Functional或Timing)和仿真输入文件。 5. 检查环境变量是否生效:重启Quartus Prime(以确保环境变量被重新加载),然后尝试重新运行仿真。 6. 如果问题仍然存在,可以尝试手动启动Questa软件(在Questa的安装目录下运行vsim),看是否能够正常启动。如果可以,说明Questa安装和许可证没有问题,问题可能出在Quartus的配置上。如果手动启动也失败,则检查许可证文件是否正确以及环境变量设置是否正确。 7. 另外,引用[2]提到增量编译,虽然与当前问题关系不大,但可以注意在大型设计中使用增量编译可以节省时间。 8. 如果使用的是Questa Starter Edition,请注意它可能不支持某些高级特性,但一般的仿真应该没有问题。 总结:无法启动Questa Intel FPGA仿真软件的问题,主要围绕安装、许可证和环境变量。按照以上步骤检查,应该能解决问题。 §§相关问题§§ 1. 如何申请Questa-Intel FPGA Starter Edition的免费许可证? 2. Quartus Prime中如何配置第三方仿真工具? 3. 除了设置环境变量,还有哪些方法可以指定Questa的许可证文件? 4. 如何验证Questa Intel FPGA仿真软件是否安装正确? </think> ### 解决 Quartus Prime 编译 CPLD 程序时 NativeLink 仿真失败问题 此问题通常由 **Questa 仿真软件配置错误**或**许可证设置异常**引起,以下是完整的排查与解决流程: --- #### **步骤 1:验证 Questa-Intel FPGA 安装状态** 1. 打开 Quartus Prime 安装目录下的组件管理器 - 路径示例:`<Quartus 安装目录>/questa_fse/` 2. 检查是否存在 `win32` 或 `win64` 文件夹(取决于系统位数) 3. 确认是否包含以下关键文件: - `vsim.exe`(主程序) - `mgcld.exe`(许可证服务端) - `mgls.dll`(许可证组件) ▶ 若缺失,需重新安装并勾选 **Questa-Intel FPGA Starter Edition**[^3] --- #### **步骤 2:配置许可证环境变量** ##### 正确设置方法: ```plaintext LM_LICENSE_FILE = <许可证文件>.dat MGLS_LICENSE_FILE = <许可证文件>.dat ``` 1. **获取许可证文件** - 访问 [Intel FPGA 许可中心](https://www.intel.com/content/www/us/en/software/programmable/licensing-support.html)申请免费 Starter 版许可[^3] - 保存 `.dat` 文件至不含空格/中文的路径(如 `C:\FPGA_license\license.dat`) 2. **设置系统环境变量** - Windows: ```cmd setx LM_LICENSE_FILE "C:\FPGA_license\license.dat" setx MGLS_LICENSE_FILE "C:\FPGA_license\license.dat" ``` - Linux: ```bash export LM_LICENSE_FILE="/opt/FPGA_license/license.dat" export MGLS_LICENSE_FILE="/opt/FPGA_license/license.dat" ``` 3. **验证许可证生效** ```cmd # 在 Questa 安装目录下运行 vsim -c -do "exit" # 应返回 "License checkout successful" ``` --- #### **步骤 3:检查 Quartus 工具链配置** 1. 在 Quartus Prime 中设置路径: `Tools > Options > EDA Tool Options` - 指定 ModelSim/Questa 路径:`<Quartus 路径>/questa_fse/win64`[^4] 2. 工程级设置: `Assignments > Settings > Simulation` - **Tool name**: `Questa Intel FPGA` - **NativeLink settings**: 勾选 `Run gate-level simulation automatically` --- #### **步骤 4:排查常见错误场景** | **错误现象** | **解决方案** | |---------------------------|------------------------------------------| | `Error: Failed to start vsim` | 检查防火墙是否阻止 `vsim.exe` 和 `mgcld.exe` | | `License checkout failed` | 重新安装 FlexNet 服务:`mgcld -i`[^4] | | 路径含空格/中文 | 迁移安装目录至全英文路径(如 `C:\FPGA\`) | --- #### **步骤 5:测试仿真流程** 1. 创建最小测试工程(如 2 输入 AND 门) 2. 运行:`Processing > Start Simulation` 3. 观察输出窗口: ✅ 成功标志:`# ** Note: Simulation stopped"` ❌ 失败标志:`Error: NativeLink simulation flow failed` > **注意**:Starter 版不支持部分高级特性(如 UVM),但对 CPLD 基础仿真足够[^2][^3]。 --- #### **最终验证** 执行命令检查环境完整性: ```cmd quartus_sh --tool=questa_cmd -c "vlib work; vlog test.sv; vsim test" ``` 若显示仿真波形窗口,表明问题已解决。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值