when I design a project, there are many modules in this project, in one of the modules (not the top module) I mark the wrong io type (for example: input tag to output), and in the module This io doesn't have any value assigned just flags error and then I synthesize it in quartus successfully but in real application it doesn't work my question is:
How can I set quartus to find this error during the sythesize phase?
Hi, perhaps I didn't yet understand the example. I believe you'll get compilation errors in most cases.
Connecting an output port to a signal that is expected to drive an input will give a multiple driver error, because the signal is already driven. The reverse situation won't cause an error in the upper hierarchhy level, just leave an undriven signal. But in the lower hierarchy (module implementation) level, you can't drive the erroneously defined input without causing an error.
So you are apparently talking about a consistently designed module that is connected erroneously in the upper hierarchy. I think confusing in- and output ports is only one of many possible wrong connections and no particular case.
You'll want some kind of verification, e.g. with a simulator. It an easily mark undriven signals.
First of all thanks for your reply, I'll give you an example to describe the problem I'm having.
You can see the Main_Seq module, PWRGD_a is the input, but I marked it as output. The final result b_EN will become high during simulation, which is also successful in quartus sythesize, but b_EN will not become high in the actual synthesis circuit.
Do you know how to verify this problem or use some settings in sythesize to avoid this problem?
You're not seeing an issue because you have an intermediary wire, w_PWRGD_a, so you're never connecting the output of Main_Seq to top. The names can be the same in different levels of hierarchy.
As for why b_EN goes high in simulation and not in hardware, that's not as clear unless I put it into Quartus.
In STP, I'm seeing b_EN high when using input PWRGD_a in Main_Seq.v. While seeing b_EN low when using output PWRGD_a in Main_Seq.v. I think the actual synthesis circuit result is the correct one because need input PWRGD_a to make b_EN high as b_EN depends on the if(PWRGD_a) begin.
However, I'm seeing same result (b_EN high) for both situation in simulation. I'll further confirm with the internal engineering team.
You are right because this is a real problem we have in real systems, when we simulate everything is correct and we load to FPGA it does not work, so the synthesized circuit is correct, but how do I get this in simulation The problem is what we care about, so hopefully you can tell me what I can do in the simulation to prevent this problem, thanks.