Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

I2C and Modelsim

Altera_Forum
Honored Contributor II
2,113 Views

I have a NIOS II system created with a bidirectional I2C SDA pin on SOPC.  

 

How can I add a pullup to this pin, as a pin in an SOPC component, so I can simulate my design?  

 

Thank you.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
1,078 Views

You need to do it in your testbench. And you should do it for SCL as well. 

 

In Verilog, declare the signal as tri1. 

In VHDL, declare it as std_logic as usual but add an assignment of 'H'.
0 Kudos
Altera_Forum
Honored Contributor II
1,078 Views

What testbench? The testbench is generated by SOPC by clicking the simulation checkbox.

0 Kudos
Altera_Forum
Honored Contributor II
1,078 Views

Ah I think I got you. Ignore what I just said. I will get back if what I try now does not work.  

 

Thank you.
0 Kudos
Altera_Forum
Honored Contributor II
1,078 Views

In Assignment Editor choose "Passive Resistor" for a pin and set it to Pull-Up. This is for functional simulation only.

0 Kudos
Altera_Forum
Honored Contributor II
1,078 Views

I am running the modelsim simulation from eclipse so only the sopcinfo/bsp stuff is being simulated. That is my problem.

0 Kudos
Reply