Forum Discussion
Simulating the Generic Serial Flash Interface with ModelSim and Quartus 19.1
- 4 years ago
I was able to simulate the flash by using the method explained in the linked article.
It is necessary to create a wrapper for the flash simulation model, that your vendor will (hopefully) provide.
In my case, the simulation model was only available in Verilog and the wrapper had to be in Verilog too, because of naming issues (VHDL doesn't allow for signals to end with an "_").My wrapper asmi_sim_model.v looks like this:
`timescale 1ps/1ps module asmi_sim_model( input wire clk, input wire qspi_pins_dclk, input wire qspi_pins_ncs, inout wire [3:0] qspi_pins_data ); // third party flash simulation module <name_of_your_flash_sim_model> device_model( .S(qspi_pins_ncs), .C_(qspi_pins_dclk), .HOLD_DQ3(qspi_pins_data[3]), .DQ0(qspi_pins_data[0]), .DQ1(qspi_pins_data[1]), .Vcc('d1800), .Vpp_W_DQ2(qspi_pins_data[2]) ); endmoduleTo instantiate the wrapper in my platform designer testbench I also had to create the corresponding _hw.tcl.
The GSFI ASMI SPI interface has to be exported and connected to the asmi_sim_model wrapper. ENABLE_SIM_MODEL has to be deactivated.
It was also necessary to link all the files the flash simulation model needs in the asmi_sim_model_hw.tcl.I hope this answer helps whoever struggles with the same problem.
Best Regards,
Florian
Hi,
This is known issue and planned to fix in Quartus II version 21.1 std .
There is workaround to bypass this error: by manually disabling the "Enable Simulation" setting of IP to perform the gate level simulation.
| "enable_simulation" | STD | PRO |
| TRUE | the user will need to add a wrapper module "asmi_sim_model". And instantiate a Flash Simulation model in this wrapper. | An EPCQ simulation model will be instantiated |
| False | ASMI connection is left unconnected | the user will need to add a wrapper module "asmi_sim_model". And instantiate a Flash Simulation model in this wrapper. |
A wrapper module "asmi_sim_model" and 3rd party flash model is needed to resolve the issue.
regards,
Farabi
- FHint4 years ago
Occasional Contributor
Hello,
I am using the STD version. Does that mean I have to keep the "ENABLE_SIM_MODEL" at "true" an just add a component called "asmi_sim_model" to the Qsys system that I want to simulate? Or do I need to disable "ENABLE_SIM_MODEL" and add the component?
Best Regards,
Florian - FHint4 years ago
Occasional Contributor
I have now tried to simulate the GSFI with "ENABLE_SIM_MODEL" disabled but the error message persists:
# ** Error (suppressible): (vsim-3584) ./../modelsim/sim/../intel_generic_serial_flash_interface_if_ctrl_191/sim/flash_ctrl_tb_intel_generic_serial_flash_interface_if_ctrl_191_qkgb6ua.sv(860): Module parameter 'ENABLE_SIM_MODEL' not found for override.
# Time: 0 ps Iteration: 0 Instance: /test_program/flash_ctrl_tb_inst/intel_generic_serial_flash_interface_top_0/qspi_inf_inst File: ./../modelsim/sim/../intel_generic_serial_flash_interface_if_ctrl_191/sim/flash_ctrl_tb_intel_generic_serial_flash_interface_if_ctrl_191_qkgb6ua.svIt seems that not the "true" or "false" was the problem but rather the existence of the parameter itself.
Maybe I have misunderstood the solution you mentioned above. Is the wrapper meant to contain the GSFI too?
Best Regards,
Florian