GithubHelp home page GithubHelp logo

Comments (7)

zoltanp avatar zoltanp commented on May 23, 2024

Hi BenjiWiebe,

I assume you are using the current KDE4 port of KTechLab 0.3.

I have a few questions related to the issue:

  • How much CPU usage does ktechlab do, when you use the 50Hz Clock Input? And is there any CPU power management policy set on your system?
    I expect that ktechlab uses a lot of CPU time, but hopefully it doesn't force the CPU to generate too much heat and make the CPU to enter thermal protection -- read: downclocking -- region. Normally this should not happen, but I consider that it is good to be verified. Also the CPU frequency governor might make the CPU to jump between operating frequencies, and cause strange timings in ktechlab.
  • In the current implementation, ktechlab
    • refreshes the display at 50 Hz by default (as far as I remember). This is configurable.
    • runs the simulation loop 50 times a second
    • in each simulation loop, it runs 200 simulation steps
    • in each simulation step it might change the state of the Clock Input.

So the actual output signal of the clock input at 50 Hz is very heavily undersampled by the display, and any rounding error in time calculation this might exhibit the behavior you are describing. Still, in that case the actual signal generated by clock input should be correct -- this can be verified by connecting the clock input to a divider.

I will verify if the Clock Input's code is "robust" and also I will verify that it outputs the expected signal.

from ktechlab.

BenjiWiebe avatar BenjiWiebe commented on May 23, 2024

@zoltanp I tried forcing the CPU speed to 4Ghz, and the issue persisted (and CPU usage was ~89% of one core, and the temperature was 38.0°C). Also, with the clock input hooked up to a counter, the counter was counting the pulses I could see -- that is, the output of the counter would increment steadily and then suddenly increment by 4 or 5 far faster than it had been going, and then revert to the slow speed.

from ktechlab.

zoltanp avatar zoltanp commented on May 23, 2024

I have tried to reproduce the issue on 32 and 64 bit systems, and I coldn't. I made a test circuit with JK-flip-flops used as counters, as on the binary counter I couldn't identify the pins -- I will have to fix that bug, too.

The picture below shows the idea of the test circuit and the output. The "sawtooth" signal on the DAC is regular, so the circuit goes through all of the expected states.

ktechlab-clock-input-test

I can send you the circuit I have made for testing, just please propose a way of transmitting the circuit file.

The code of the Clock Input component doesn't have any "obvious" issues, but it is too convoluted in my opinion, and it might cause some unexpected behavior. For fully validating the code, I will need more time.
I suspect that there is some random (undefined) behavior in the code, just it needs more investigation.

from ktechlab.

BenjiWiebe avatar BenjiWiebe commented on May 23, 2024

@zoltanp I think it is maxing out the CPU. But not 'ktechlab', it is X.org that is maxing out the CPU while ktechlab is running. You can email me that circuit at benjiwiebe14 at gmail dot com.

Here is a circuit that when started, the osc display is smooth at first, but then every couple of seconds will change speed (the signal displayed is not incorrect; the display speed will suddenly slow down and speed up.)

EDIT: I think there is a misunderstanding here; the osc display does show the correct signal, it just updates at random speeds, i.e. the speed of simulation will change randomly.

from ktechlab.

zoltanp avatar zoltanp commented on May 23, 2024

@BenjiWiebe It made me curios: what graphics hardware and driver do you use when the screen update starts to behave strangely? Also: you can change the Display Refresh Rate in settings, on the General tab. Maybe settings a lower or lowest refresh rate (25 or 10 FPS), could work around your issue.

from ktechlab.

BenjiWiebe avatar BenjiWiebe commented on May 23, 2024

@zoltanp I was not aware of the Display Refresh Rate settings, thanks for pointing that out. I think I have came to the conclusion that the issue was due to the CPU being maxed out. I can not reproduce the issue now. Your circuit worked fine, even when I set the display refresh rate to 100fps. Closing.

P.S. The graphics hardware and driver: Whatever open-source driver comes with Fedora 21 for the driver, and Radeon HD 6970.

from ktechlab.

zoltanp avatar zoltanp commented on May 23, 2024

@BenjiWiebe Good to hear that it works now. Thanks for testing and if you have any issue, feel free to signal it.

from ktechlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.