cpu影响matlab仿真速度吗,Proteus仿真速度很慢的分析

fbb41e8025f8fe522e54c69b958b53a0.png

类型:行业软件大小:1.1M语言:中文 评分:6.5

标签:

立即下载

这篇文章是我的个人实践经验:

很多朋友在做Proteus硬件仿真的时候可能都碰上了仿真速度慢的问题,在点击了开始仿真之后,CPU过载,速度极慢,无法正常进行仿真;Proteus在信息栏提示CPU被使用情况,可能高达90%到100%,并没有按照真实速度仿真,点击信息栏中的提示信息就弹出一个对话框,说是 Simulation is not running in real time due to excessive CPUload,鼠标点击提示,会展开一个消息框,下面就是消息框内的内容:

This message has been generated because the simulation has been unable to keep up with real time for more than 20 consecutive simulation frames. This does not affect the accuracy of the simulation in any way, but it will mean that the simulated system may respond much more slowly to interactive events(e.g. push buttons).

See Also:

How to make simulations run faster?

这里的说明中可以看到至少两个信息:第一,速度慢并不影响仿真精度;第二,我们可以点击最下方那句话打开另一个链接来加速仿真;那么,我们就继续按照提示来寻找答案。(也许我们的Proteus版本不同,这些链接打开顺序和方法可能不一样,我是用的是7.1的版本)点击 How to make simulations run faster?打开Proteus的帮助,进入一个英文界面,我把原文全部贴在这里,之后和你一起解读。

ADVANCED TOPICS

HOW TO MAKE INTERACTIVE SIMULATIONS RUN FASTER

Introduction

Although Proteus VSM is able to run many interactive simulations in real

time, it should be fairly obvious that this cannot be the case for all

circuits. For example, it is perfectly possible to draw a circuit that will

oscillate at 1GHz, but there is no way that this can be simulated in real

time on a computer that may not even execute one machine instruction in 1ns.

In this section, we will explain in a little more detail what determines the

complexity of a simulation and how you can optimize a circuit to maximize the

simulation speed.

Using Digital Resistor and Diode Models

First and foremost in this context, it is vital to understand the difference

between analogue and digital simulation within ProSPICE. This is because the

simulation of digital circuitry is two or three orders of magnitude (i.e. up

to 1000 times) faster than the simulation of analogue circuitry. It is for

this reason that ProSPICE contains a digital simulator at all - that by

representing the operation of digital components as an event driven process,

a great deal of unnecessary computation can be avoided.

For example, whilst a PC with 600MHz P3 processor can simulate around 2

million digital events per second, the same computer will only be able to

simulate a sine wave generator running up to about 2kHz before the CPU load

reaches 100%. Such a waveform will require about 60,000 analogue timepoints

to be computed per second, and each timepoint will require a convergent

solution of the circuit nodal equations to be established - a process vastly

more complex than processing a simple digital event.

For many components, it should be fairly intuitive as to whether analogue or

digital simulation will be required. For example, nearly all TTL and CMOS

parts are represented by digital models, whereas analogue ICs such as op-

amps, comparators and so forth are represented by analogue models. All

components which are represented by standard SPICE models require analogue

simulation.

However, a grey area arises for components which - though strictly analogue

in nature - can be represented by a digital model for some purposes. In

particular, diodes - and perhaps more surprisingly - resistors fall into this

category. This becomes highly relevant in the context of wire-or logic, pull

-up resistors, devices with open-collector outputs, and in diode-resistor

logic networks.

Example 1 - Wire-Or Logic

The following circuit section shows a typical wire-or logic network:

358c25874a6193d5e44d762c87ec2660.png

U1:A and U1:B have open-collector outputs and can only sink current. A logic

1 output level results in a high impedance condition. In terms of DSIM, this

means that the gate outputs drive either an SLO (strong low) or a FLT

(floating) logic state. Now if resistor R1 is modelled in the analogue

domain, PROSPICE must insert a digital to analogue interface object between

the logic gates and the resistor, and then an analogue to digital interface

object between the resistor and the input to U2:A. This will result in

wonderfully detailed simulation of the rise-fall waveforms at this node, and

the current flow through R1, but will also result in a great deal of

computation every time the output of U1:A or U1:B changes state.

All this can be avoided if R1 is modelled digitally. In this case, its

behaviour is to convert the SHI logic state of VCC to a WHI (weak high) logic

level. When either NAND gate pulls low, the SLO state overrides the WHI state

from the resistor and the net state is resolved to be logic low. But when

neither gate sinks current, the WHI state beats the FLT state and the net

rises to logic high. All this can be managed within the digital simulation

paradigm and no analogue simulation is required.

Therefore, pull up resistors of any kind should almost always be modelled

digitally.

Example 2 - Diode-Resistor Logic

Another case where seemingly analogue circuitry can be modelled in the

digital domain is diode-resistor networks of the sort shown below. These are

often found around keypad scanning circuitry where the diodes serve to

prevent short circuits between the row driving lines if more than more than

one key is depressed simultaneously.

As with the wire-or logic example, ProSPICE will quite happily model this in

the analogue domain but it will be computationally expensive. If a digital

resistor model is used as above, and a diode is seen as a device which will

pass only low logic level from cathode to anode and only a high logic level

from anode to cathode, then the whole network can once again be modelled

digitally.

Since keypad scanning routines tend to operate at some speed, and there are

often numerous diodes and resistors, this is a very important optimization to

be aware of.

How to Select the Digital Resistor Model

1.    Point at the resistor you wish to change and press CTRL-E.

2.    Click the Edit All Properties as Text checkbox.

3.    Change the PRIMITIVE property to read

PRIMITIVE=DIGITAL,RESISTOR

If you are building a circuit from scratch, and know that you will want a

particular resistor to be modelled digitally, you can also achieve this by

picking the PULLUP or PULLDOWN models from the component library. This

devices already contains the PRIMITIVE property as above.

How to Select the Digital Diode Model

1.    Point at the diode you wish to change and press CTRL-E.

2.    Click the Edit All Properties as Text checkbox.

3.    Change the PRIMITIVE property to read

PRIMITIVE=DIGITAL,DIODE

4.    Delete any MODEL property, as SPICE parameters have no meaning for the

digital diode model.

If you are building a circuit from scratch, and know that you will want a

particular diode to be modelled digitally, you can also achieve this by

picking the DIODE-DIGITAL device the component library. This device already

contains the PRIMITIVE property as above.

Optimizing Memory Accesses to External RAM and ROM

Many larger microprocessor designs make use of ROM, RAM or EEPROM memory

devices external to the microcontroller itself. These may store the program

code, or be used to supplement internal SRAM present within the CPU chip

itself. Given a correct address decoding circuit, and assuming that the

memory device is modelled, Proteus VSM will correctly simulate such designs

as drawn. When the CPU accesses external memory, the model will drive the

address, data and control lines appropriately, and external decode logic and

memory model will respond by reading or writing the appropriate locations.

This is quite useful if you wish to verify that your memory decoding

circuitry works as designed, but is also extremely expensive in terms of

computation. Setting up a 16 bit address will create a minimum of 16 digital

events and reading or writing a byte of data to/from data bus will generate

another 8. Removing the data from the bus afterwards will create another 8

events. Where address and data lines are multiplexed, as in the above HC11

design, even more events will be generated. All this compares very

unfavourably with the ability of a VSM CPU model to execute an instruction

using just one event per machine cycle.

Therefore, we have provided the CPU models with the ability to simulate

accesses to external memory internally to the model. At the time of writing

this applies to the 8051,

HC11 and the larger AVR CPU models. External memory may be declared using

EXTRAM, or EXTROM properties which specify the memory range for each block of

external memory. Full details are provided in the model specific help for

these processors, which you can access from the Edit Component dialogue form,

or from the Start Menu.

Once the external memory map has been defined in this way, instructions which

access external memory within the specified ranges can be simulated without

generating large numbers of digital events. Accesses to memory mapped

peripherals can still be fully simulated, since these will lie at locations

outside the memory ranges specified in the EXTRAM and EXTROM properties.

这里就列出了所有问题的根源了;各位朋友不妨多看看这里的英文帮助,磨刀不误砍柴

工,这里的帮助内容比任何人的经验之谈要高明得多;

好了,让我来读读这里的帮助,下面是我读出的基本内容之一:

第一:使用数字式的电阻和二极管(Using Digital Resistor and Diode Models)

这句话是我的翻译,原文的意思是如果把所有的二极管和电阻都看成是模拟量那样仿真的话,Proteus的速度会大大下降;所以所有的上拉电阻都可以看成是数字量的模拟(原文是:Therefore, pull up resistors of any kind should almost always bemodelled digitally.);而一些作为逻辑门电路用的二极管也可以看成数字式的;因此,需要对仿真的元件进行设置。

1)对电阻的设置(How to Select the Digital Resistor Model) How to Select the Digital Resistor Model

1.    Point at the resistor you wish to change and press CTRL-E.

2.    Click the Edit All Properties as Text checkbox.

3.    Change the PRIMITIVE property to read

PRIMITIVE=DIGITAL,RESISTOR

0cbb417099288e408049c68e78f689ba.png

2)对二极管的设置(How to Select the Digital Diode Model)

1.    Point at the diode you wish to change and press CTRL-E.

2.    Click the Edit All Properties as Text checkbox.

3.    Change the PRIMITIVE property to read

PRIMITIVE=DIGITAL,DIODE

4.    Delete any MODEL property, as SPICE parameters have no meaning for thedigital diode model

另外说明,在编辑Properties时,在文本框里键入的内容若用中括号{}括起来,那么在仿真界面就不会显示出来,比如

{MODFILE=74AND2.MDF}

{PACKAGE=DIL14}

{ITFMOD=TTL}

第二:Optimizing Memory Accesses to External RAM and ROM

这个问题我还没有遇到过,也不太明白其中的内容,希望比较熟悉单片机方面有的朋友做补充了!!!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/441060.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【HDU - 5900】QSC and Master(区间dp)

题干: Every school has some legends, Northeastern University is the same. Enter from the north gate of Northeastern University,You are facing the main building of Northeastern University.Ninety-nine percent of the students have not …

php set_timeout,和 JS 一样的 php setTimeout 函数

112016-07-11 21:34:11 08:00szopen 貌似没有复杂啊//enable ticksdeclare (ticks 1);//setTimeout event list$timeoutQueue new SplObjectStorage;register_tick_function(function() {global $timeoutQueue;foreach ($timeoutQueue as $v) {$callBack $v();if (is_callab…

mysql 7天自动拒单功能,mysql查询最近7天的数据,没有数据自动补0

select DATE( createtime) date , createtime, count(1) as count from order表 where DATEDIFF( now(), createtime)<7group by date ;12 月九号没有;给他在关联一张日期的表;--生成从今天开始完整的7天日期DECLARE LastSevenDaytable(day date)DECLARE StartDaydate …

【UVA - 10038】Jolly Jumpers (模拟,水题,标记)

题干&#xff1a; 题目大意&#xff1a; 要任意相邻的两个数的绝对值在[1,n)&#xff0c;而且这个范围内的每个数都要出现一次。 解题报告&#xff1a; 直接模拟就行了、 AC代码&#xff1a; #include<cstdio> #include<iostream> #include<algorithm> …

基于维纳滤波的语音增强算法 matlab,基于维纳滤波语音增强算法的改进实现

通过对维纳滤波的介绍,实现了基本维纳滤波效果;利用两级维纳滤波和两级滤波器组滤波方法实现了语音增强,达到了良好的效果。维普资讯 http://doc.docsou.com文章编号&#xff1a;0 2 8 8 (o 7 0 - 0 4 0 10—6 4 2 o )1 0 4 - 3基于维纳滤波语音增强算法的改进实现白文雅&#…

【CodeForces - 245H 】Queries for Number of Palindromes (带容斥的区间dp)

题干&#xff1a; Youve got a string s  s1s2... s|s| of length |s|, consisting of lowercase English letters. There also are q queries, each query is described by two integers li, ri (1 ≤ li ≤ ri ≤ |s|). The answer to the query is the number of …

php7 获取文件类型,太简单了!PHP获取文件扩展名的7中方法

PHP中获取文件扩展名的方法第一种&#xff1a;$file x.y.z.png;echo substr(strrchr($file, .), 1);解析&#xff1a;strrchr($file, .)strrchr() 函数查找字符串在另一个字符串中最后一次出现的位置&#xff0c;并返回从该位置到字符串结尾的所有字符第二种&#xff1a;$file…

【EOJ Monthly 2018.12 - A,B,C】套题训练,部分题解

A. 题干&#xff1a; A. 仰望星空 单测试点时限: 2.0 秒 内存限制: 512 MB 你就这样静坐在草地上&#xff0c;离我稍远的地方。 我用眼角瞅着你&#xff0c;你什么话也别说。 语言是误会的根源。 但是&#xff0c;每天&#xff0c;你可以坐得离我近一些…… 你和她一起仰头…

php android 复制粘贴板,Android_Android剪贴板用法详解,本文实例详述了Android剪贴板的 - phpStudy...

Android剪贴板用法详解本文实例详述了Android剪贴板的用法&#xff0c;分享给大家供大家参考。具体方法分析如下&#xff1a;这里首先需要注意的一点&#xff0c;就是在使用Android剪贴板的时候大家只记住一点就行了&#xff0c;不管是安卓设备还是PC机&#xff0c;复制粘贴在同…

【Uva - 10047 】The Monocycle(搜索,bfs记录状态)

题干&#xff1a; Uva的题目就不粘贴题干了&#xff0c;&#xff0c;直接上题意吧。 有你一个独轮车&#xff0c;车轮有5种颜色&#xff0c;为了5中颜色的相对位置是确定的。有两种操作&#xff1a;1.滚动&#xff1a;轮子必须沿着顺时针方向滚动&#xff0c;每滚动一次会到达…

matlab中bwlabel意思,Matlab 里bwlabel 函数的具体含义

Matlab函数bwlabel&#xff1a;在二值图像中标记连通区域用法&#xff1a;L bwlabel(BW,n)返回一个和BW大小相同的L矩阵&#xff0c;包含了标记了BW中每个连通区域的类别标签&#xff0c;这些标签的值为1、2、num(连通区域的个数)。n的值为4或8&#xff0c;表示是按4连通寻找区…

php百度搜索框代码,基于jquery的仿百度搜索框效果代码_jquery

先看看整个的效果图&#xff1a;图一&#xff1a;图二&#xff1a;图三&#xff1a;图四&#xff1a;大概的效果图就这样&#xff0c;接下来直接看源码页面&#xff1a;CSS&#xff1a;.autoSearchText{border:solid 1px #CFCFCF;height:20px;color:Gray;}.menu_v{margin:0;pad…

【UVA - 227】Puzzle (模拟,水题)

题干&#xff1a; Puzzle A childrens puzzle that was popular 30 years ago consisted of a 5x5 frame which contained 24 small squares of equal size. A unique letter of the alphabet was printed on each small square. Since there were only 24 squares within the…

php 解析mib文件,Mib库解析

MibAnalyser介绍MibAnalyser可以解析MIB文件&#xff0c;并转化为对应的实体&#xff0c;持久化到本地。MibAnalyser分为三个模块&#xff1a;解析模块、持久化模块、工具库模块。解析模块解析模块用于解析MIB文件的语法&#xff0c;并最终生成实体列表。管理模块由于对MIB文件…

【CodeForces - 299C 】Weird Game (思维,模拟,贪心,博弈,OAE思想)

题干&#xff1a; Yaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesnt show up, Yaroslav and Andrey play another game. Roman leaves a word for each of them. Each word consists of 2n binary characte…

matlab大作业题题单,2011MATLAB大作业-题目-

(1)求解线性规划问题&#xff1a;minZ 4x1 x2 7x3s.t.x1 x2 x3 53x1 x2 x3 4x1 x2 4x3 7x1,x2 0问各xi分别取何值时&#xff0c;Z有何极小值。(2)编写一个函数&#xff0c;使其能够产生如下的分段函数&#xff1a;0.5x&#xff0c;x 2f(x) 1.5 0.25x&#xff0c;2 x 6&#xff…

【CodeForces - 298D】Fish Weight (OAE思想,思维)

题干&#xff1a; It is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-decreasing order of their weight, which is a positive number. Let the weight of the i-th type of fish be wi, then 0 < w1 ≤ …

php 字符串比较的规则,PHP字符串比较函数strcmp()与strcasecmp()的用法介绍

使用“”来判断。它和“”的区别&#xff0c;前者强调“identical(相同的&#xff0c;完全相同)”类型也要求一样&#xff1b;后者要求“equal(相等)”&#xff0c;值相同就可以了。或者使用strcmp来判断&#xff0c;但是这不能说明两个字符串是否相等。一般能用 !, 比较两个对…

【CodeForces - 140C】New Year Snowmen (贪心)

题干&#xff1a; As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergeys twins help him: theyve already made n sno…

php正文重复度,百度如何判断网页文章的重复度?两个页面相似度确认方法介绍...

在这个科技高度发达的时代&#xff0c;百度已经成为人们能获取消息的主要途径。但如今的百度&#xff0c;到处充斥着一些重复的内容&#xff0c;对用户的访问造成很大的困扰。因此&#xff0c;百度需要对网页重复进行判断&#xff0c;对重复的网页&#xff0c;只选取一些高质量…