Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Tri-state buffer not controlling outputs

2 posters

Go down  Message [Page 1 of 1]

1Tri-state buffer not controlling outputs Empty Tri-state buffer not controlling outputs Tue Apr 06, 2021 11:47 pm

nulik



Hi there,
I tried tri-state buffer, but apparently the Enable output is not functioning as expected. If the buffer is enabled it should pass outputs, but it is not working this way, the enable output has no effect at all.

Here on this picture the output should be 0V , but I am getting 5V

Tri-state buffer not controlling outputs Trista10



Last edited by arcachofo on Fri Dec 24, 2021 3:11 am; edited 1 time in total (Reason for editing : Marked as solved (green color))

arcachofo

arcachofo

Hi.

Which version are using for these tests?

In the picture, that buffer is working correctly.
Output Enable is active low as shown in the pin (it has a circle).

It should disable the output by setting OE pin high.
Is this working correctly?

nulik



arcachofo wrote:Hi.

Which version are using for these tests?

In the picture, that buffer is working correctly.
Output Enable is active low as shown in the pin (it has a circle).

It should disable the output by setting OE pin high.
Is this working correctly?


I am using 0.4.15.
Well, I the thing is, when I turn on/off the enable pin, I see no difference. Looks like I sent the wrong picture. But how do you make an Active HIGH tri-state buffer? (with no bubble at enable pin) ?

arcachofo

arcachofo

Yes, you are right, buffer is doing all kind of crazy things.

But how do you make an Active HIGH tri-state buffer? (with no bubble at enable pin) ?
By now there is no way to configue this.
You should do it outside the buffer, adding an inverter like this:

Tri-state buffer not controlling outputs Trista10

nulik



arcachofo wrote:
By now there is no way to configue this.
You should do it outside the buffer, adding an inverter like this:

that will work as a subcircuit! thanks a lot!!!

arcachofo

arcachofo

I found and solved the problem.

You saved me a lot of time, I was struggling with some misterious problems and this pointed me directly to the smoking gun...

Thank you very much!!

This is a critical problem, I will release 0.4.15-SR1 in a few days, one week at most.

nulik



arcachofo wrote:

This is a critical problem, I  will release 0.4.15-SR1 in a few days, one week at most.

if it is not so big, could you post affected source code lines? I will patch it myself.

arcachofo

arcachofo

if it is not so big,  
Yes, it is critical, this is not about buffers, it breaks the simulation in many cases.

could you post affected source code lines? I will patch it myself.
Source code with this and a bunch other bugs fixed:
https://code.launchpad.net/~arcachofo/simulide/simulide_0.4.14

nulik



arcachofo wrote:
if it is not so big,  
Yes, it is critical, this is not about buffers, it breaks the simulation in many cases.

could you post affected source code lines? I will patch it myself.
Source code with this and a bunch other bugs fixed:
https://code.launchpad.net/~arcachofo/simulide/simulide_0.4.14

big enough, I better copy the files.

btw, I fixed null pointer crash in buffer.cpp and moved view port boundaries to constants so you can create larger circuits. Feel free to include if you consider it important:

Code:
diff -Naur orig_sources/simulide_0.4.15-Final_Sources/src/gui/circuitwidget/circuitview.cpp simulide_0.4.15-Final_Sources/src/gui/circuitwidget/circuitview.cpp
--- orig_sources/simulide_0.4.15-Final_Sources/src/gui/circuitwidget/circuitview.cpp   2020-12-22 02:54:30.000000000 -0600
+++ simulide_0.4.15-Final_Sources/src/gui/circuitwidget/circuitview.cpp   2021-04-05 21:48:34.134079661 -0500
@@ -30,7 +30,8 @@
 #include "utils.h"
 
 CircuitView*  CircuitView::m_pSelf = 0l;
-
+#define VP_WIDTH 6400
+#define VP_HEIGHT 2400
 CircuitView::CircuitView( QWidget *parent )
            : QGraphicsView( parent )
 {
@@ -45,7 +46,7 @@
 
     //clear();
 
-    viewport()->setFixedSize( 3200, 2400 );
+    viewport()->setFixedSize( VP_WIDTH, VP_HEIGHT );
     bool scrollBars = MainWindow::self()->settings()->value( "Circuit/showScroll" ).toBool();
     if( scrollBars )
     {
@@ -139,7 +140,7 @@
     m_enterItem = 0l;
     m_scale = 1;
    
-    m_circuit = new Circuit( -1600, -1200, 3200, 2400, this );
+    m_circuit = new Circuit( -(VP_WIDTH/2), -(VP_HEIGHT/2), VP_WIDTH, VP_HEIGHT, this );
     setScene( m_circuit );
     centerOn( 900, 600 );
     //setCircTime( 0 );
@@ -329,8 +330,8 @@
             QSvgGenerator svgGen;
 
             svgGen.setFileName( fileName );
-            svgGen.setSize( QSize(3200, 2400) );
-            svgGen.setViewBox( QRect(0, 0, 3200, 2400) );
+            svgGen.setSize( QSize(VP_WIDTH, VP_HEIGHT) );
+            svgGen.setViewBox( QRect(0, 0, VP_WIDTH, VP_HEIGHT) );
             svgGen.setTitle( tr("Circuit Name") );
             svgGen.setDescription( tr("Generated by SimulIDE") );
 
diff -Naur orig_sources/simulide_0.4.15-Final_Sources/src/gui/circuitwidget/components/logic/buffer.cpp simulide_0.4.15-Final_Sources/src/gui/circuitwidget/components/logic/buffer.cpp
--- orig_sources/simulide_0.4.15-Final_Sources/src/gui/circuitwidget/components/logic/buffer.cpp   2019-08-05 11:43:54.000000000 -0500
+++ simulide_0.4.15-Final_Sources/src/gui/circuitwidget/components/logic/buffer.cpp   2021-04-06 16:25:12.777282716 -0500
@@ -55,7 +55,9 @@
         if( m_outEnPin->isConnected() )
         {
             m_outEnPin->reset();
-            m_outEnPin->connector()->remove();
+            if (m_outEnPin->connector()) {
+            m_outEnPin->connector()->remove();
+         }
         }
     }
     m_outEnPin->setVisible( t );
@@ -66,7 +68,11 @@
 void Buffer::remove()
 {
     if( m_tristate )
-        if( m_outEnPin->isConnected() ) m_outEnPin->connector()->remove();
+        if( m_outEnPin->isConnected() ) {
+            if (m_outEnPin->connector()) {
+               m_outEnPin->connector()->remove();         
+         }
+      }
    
     Gate::remove();
 }
diff -Naur orig_sources/simulide_0.4.15-Final_Sources/src/gui/circuitwidget/node.cpp simulide_0.4.15-Final_Sources/src/gui/circuitwidget/node.cpp
--- orig_sources/simulide_0.4.15-Final_Sources/src/gui/circuitwidget/node.cpp   2021-03-22 13:04:12.000000000 -0600
+++ simulide_0.4.15-Final_Sources/src/gui/circuitwidget/node.cpp   2021-04-06 16:23:04.261635441 -0500
@@ -89,7 +89,11 @@
         if( conectors == 2 ) joinConns( con[0], con[1] );  // 2 Conn
         else                                               // 1 Conn
         {
-             if( m_pin[con[0]]->isConnected() ) m_pin[con[0]]->connector()->remove();
+            if( m_pin[con[0]]->isConnected() ) {
+             if (m_pin[con[0]]->connector()) {
+                m_pin[con[0]]->connector()->remove();
+            }
+         }
         }
        
         Circuit::self()->compList()->removeOne( this );

arcachofo

arcachofo

nulik wrote:btw, I fixed null pointer crash in buffer.cpp and moved view port boundaries to constants so you can create larger circuits. Feel free to include if you consider it important:
Thanks, I will apply those changes.

I will move this topic to "Report Bugs" section.

Also split the issue reported by Mistral into another thread:
https://simulide.forumotion.com/t162-simple-4bit-cpu-spike-in-pc-clk-pin

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum