simulation

Why should an HDL simulation (from source code) have access to the simulator's API?

倖福魔咒の 提交于 2019-12-10 13:33:01
问题 This is a question inspired by this question and answer pair: call questa sim commands from SystemVerilog test bench The questions asks how Verilog code could control the executing simulator (QuestaSim). I saw similar questions and approaches for VHDL, too. So my question is: Why should a simulation (slave) have power of its simulator (master)? What are typical use cases? Further reading: call questa sim commands from SystemVerilog test bench VerTcl - A Tcl interpreter implemented in VHDL 回答1

How to simulate incoming calls on a real device? [closed]

青春壹個敷衍的年華 提交于 2019-12-10 13:13:25
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . For testing purposes I want to simulate/spoof incomming calls on a real android device (ie. not the emulator). I know that DDMS provides this feature for emulators, but I am unable to find a solution for actual

Simulink - How to run a simulation in a simulation?

烂漫一生 提交于 2019-12-10 12:16:46
问题 I am running a simulation that contains among other things a subsystem (or referenced model) that is a simulation by itself and that needs to be run fully at certain times before resuming the main simulation. Basically, at time t the main simulation needs the outputs of the subsystem. The subsystem is then triggered and runs a simulation for 6 seconds (the subsystem simulation is time dependent). Then the main simulation uses the outputs of the subsystem. The problem here is that when the

Why is my astronomy simulation inaccurate?

人走茶凉 提交于 2019-12-10 10:53:48
问题 I've made a program that simulates movement of bodies in the solar system, however, I'm getting various inaccuracies in my results. I believe that it probably has something to do with my integration method. tl;dr there's a slight difference between the position and velocity of Earth between my simulation and NASA's data, if you could please look at my code below and tell me whether my math is wrong. The test I've ran is a 10 day long (864000 seconds) simulation, that starts at Thu Mar 13 18

How to store and push simulation state while minimally affecting updates per second?

你说的曾经没有我的故事 提交于 2019-12-10 10:13:18
问题 My app is comprised of two threads: GUI Thread (using Qt) Simulation Thread My reason for using two threads is to keep the GUI responsive, while letting the Sim thread spin as fast as possible. In my GUI thread I'm rendering the entities in the sim at an FPS of 30-60; however, I want my sim to "crunch ahead" - so to speak - and queue up game state to be drawn eventually (think streaming video, you've got a buffer). Now for each frame of the sim I render I need the corresponding simulation

N-Body CUDA optimization

ε祈祈猫儿з 提交于 2019-12-09 21:26:23
问题 I'm developing an N-body algorithm in CUDA and I would like to learn some tips and tricks for optimization. I've managed to get 16384 bodies to run at 20Flops on an NVIDIA Geforce GTX 260, which has 27 Streaming Multiprocessors. The KernelcomputeForces function is the slow poke taking about 95% of the time and I was wondering if there is anymore that I can do to optimize my code. As far as I see, I've optimized for memory-space-locality and memory-writing. Somewhere in the CUDA docs, it says

How do I generate discrete random events with a Poisson distribution?

浪子不回头ぞ 提交于 2019-12-09 10:11:46
问题 I'm aware of Knuth's algorithm for generating random Poisson distributed numbers (below in Java) but how do I translate that into calling a method, generateEvent() , randomly over time? int poissonRandomNumber(int lambda) { double L = Math.exp(-lambda); int k = 0; double p = 1; do { k = k + 1; double u = Math.random(); p = p * u; } while (p > L); return k - 1; } 回答1: If you are looking to simulate the inter-event arrival time, you want the exponential distribution. Take a look at Pseudorandom

Jelly physics 3d

淺唱寂寞╮ 提交于 2019-12-09 06:51:13
问题 I want to ask about jelly physics ( http://www.youtube.com/watch?v=I74rJFB_W1k ), where I can find some good place to start making things like that ? I want to make simulation of cars crash and I want use this jelly physics, but I can't find a lot about them. I don't want use existing physics engine, I want write my own :) 回答1: Something like what you see in the video you linked to could be accomplished with a mass-spring system. However, as you vary the number of masses and springs, keeping

Python alternative to Java applet?

白昼怎懂夜的黑 提交于 2019-12-09 05:59:52
问题 Is there an alternative to making educational Java applets for physics simulations like projectile motion, gravity, etc? 回答1: If you want it to run in a browser, you could use PyJamas - which is a Python-to-Javascript compiler and set of tools. I'm not sure how well it is maintained these days, though. 回答2: In this day and age, you might look to the HTML 5 canvas & JS. 回答3: While I'm all for the "HTML5 & JS", you can consider Jython and simply write a Java Applet in Python (2.2.3, but...)

How to simulate keyboard input in ALL applications?

£可爱£侵袭症+ 提交于 2019-12-09 05:53:15
问题 I'm writing an app (in C#) which as a part of it must simulate and send some key strokes to another application. I'm using http://inputsimulator.codeplex.com/ project for simulating keys, and it works in many applications, but in some it doesn't - i.e. Mortal Combat 4. I've googled about it, and found many answers varying from 'it's impossible' to 'you must use XXX library' etc. Those answered scared me a lot, and even nearly convinced I'm not able to do it at that time, BUT... M$ Virtual