Error when Simulating certain hierarchical sheets

I’d like to know what the following Spice error means

I am getting this error in situations where I shouldn’t be getting one because the same schematic outside of a hierarchical sheet works.

Here, the error (A few to around 50 of these):

Original line no.: [x], new internal line no.: [y]:
Closing “}” not found.

I’d just like to know what this means.

If this helps, this is a simple reproduction of the error (It’s a bit scuffed, it’s a test file, I apologise):

.title KiCad schematic
V1 +5V 0 dc 5 ac 0
V2 NC_01 0 dc 5 ac 0 pulse(0 5 0 0 0 1 3)
V4 In1 0 dc 5 ac 0 pulse(0 5 0 0 0 1 2)
V3 In2 0 dc 5 ac 0 pulse(0 5 1 0 0 1 2)
R8 /Sheet611A0EAC/sheet611A55C8/I1 +5V 2.7k
R9 Net-Q5-Pad2 In1 12k
Q5 /Sheet611A0EAC/sheet611A55C8/I1 Net-Q5-Pad2 0 0 QNPN
R2 In2 Net-Q1-Pad1 12k
R3 In1 Net-Q2-Pad1 12k
R1 /Sheet611A0EAC/sheet611A5D02/I1 +5V 2.7k
Q1 /Sheet611A0EAC/sheet611A5D02/I1 Net-Q1-Pad1 0 BC817
Q2 /Sheet611A0EAC/sheet611A5D02/I1 Net-Q2-Pad1 0 BC817
R6 /Sheet611A0EAC/sheet611A55C8/I1 Net-Q3-Pad1 12k
R7 In2 Net-Q4-Pad1 12k
R5 /Sheet611A0EAC/sheet611A5D03/I1 +5V 2.7k
Q3 /Sheet611A0EAC/sheet611A5D03/I1 Net-Q3-Pad1 0 BC817
Q4 /Sheet611A0EAC/sheet611A5D03/I1 Net-Q4-Pad1 0 BC817
R11 /Sheet611A0EAC/sheet611A5D02/I1 Net-Q6-Pad1 12k
R12 /Sheet611A0EAC/Q’ Net-Q7-Pad1 12k
R10 Out +5V 2.7k
Q6 Out Net-Q6-Pad1 0 BC817
Q7 Out Net-Q7-Pad1 0 BC817
R14 /Sheet611A0EAC/sheet611A5D03/I1 Net-Q8-Pad1 12k
R15 Out Net-Q9-Pad1 12k
R13 /Sheet611A0EAC/Q’ +5V 2.7k
Q8 /Sheet611A0EAC/Q’ Net-Q8-Pad1 0 BC817
Q9 /Sheet611A0EAC/Q’ Net-Q9-Pad1 0 BC817
.model QNPN NPN
.tran 0.001 8 0
.model bc817 NPN
.model D D
.model QNPN NPN
.model QNPN NPN
.model QNPN NPN
.model QNPN NPN
.model QNPN NPN

No problem to run your test file in standard ngspice-35 executable.

What is your KiCad version and your ngspice version?

To get the ngspice version, put this into a text box in Eeschema and run the simulator:

1 Like

I think I’ve figured it out.

I’m running KiCad v5.1.9-1 and ngspice-32.

But It doesn’t seem to have anything to do with either of those things, it’s much dumber than that:

I am almost 100% sure that the issue is the character " ’ " in my pin name Q’. Because somewhere, that got turned into a " ’ ". And somehow, the latter version works (in the ngspice-35 executable) whilst the other version does not.

I still don’t get how any of this happened but I don’t really care at this point.

Thank you for indirectly suggesting I update my stuff, which more or less led me to this.

Edit: To be specific, the intended character (Apostrophe - unicode U+0027) is not the character that is widely used for apostophes. The character which is prefered overall seems to be [Right Single Quotation mark - U+2019]. ASCII doesn’t have both. So anything which uses ASCII converts U+2019 to U+0027. Tl;dr: do NOT use apostrophes in net names.