Comments (7)
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.
@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.
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.
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.
@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.
@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.
@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.
@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)
- gspimprocessor.cpp compiling error HOT 15
- Compilation Error HOT 8
- The build fails: no member named 'W' in 'pic_processor' HOT 7
- Operational Amplifier Configurations HOT 1
- Segfault when changing element value HOT 6
- Logic voltages are too low for MOSFETs and cannot be set higher HOT 2
- Cannot build on Debian Stretch HOT 4
- Crash when dragging Voltage probe or Current probe to the window HOT 1
- battery volt button disperses HOT 4
- Unable to compile KTechLab '‘class KUrlRequester’ has no member named ‘setAcceptMode’' HOT 2
- windows installer HOT 5
- future of ktechlab HOT 3
- LC generators with inductive coupling how to create?, аnd other shortcomings of the program. HOT 2
- [ Feature Request ] market component integration or custom component creation HOT 1
- When the schematic project is saved in .circuit format but w/out .circuit extension it auto-opens as text when the program is started HOT 1
- The "Open" dialog doesn't show any files when "*|All Files" is chosen as selector HOT 3
- Rotating some elements leads to inconsistens lines HOT 1
- Program crash (segmentation fault) when changing component value HOT 6
- ktechlab.cpp:927:23: error: ‘showDialog’ is not a member of ‘KShortcutsDialog’ HOT 1
- AC voltage HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktechlab.