完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我现在在SCL编写一些刺激测试。由于非文档化,我不知道是否有另一种方法在SCL的帮助下停止模拟器中的CPU。一个例子可能是停止CPU,然后从代码中的一个参考点重新启动CPU。目的是创建一个测试特定源代码的状态机。这台机器目前正运行在等待命令上,它的工作时间不太好,这是因为时间。请给我一些提示,因为我是新手SCL脚本。谢谢AOLSOKAR。
以上来自于百度翻译 以下为原文 Hi everybody, I’m for the moment scripting some stimuli tests in SCL. Because of the non-documentation, I than wonder if there is an another way to stop the CPU in the simulator with the help of SCL? An example might be to HALT CPU and then start it again from a reference point in the code. The purpose is to create a state machine which tests specific source code. The machine are at the moment running on wait commands which are not working that good, due because of the timing. Please, also give tips due I’m a rookie SCL scripter. Thanks all Oskar |
|
相关推荐
17个回答
|
|
让我们看看我们能否消除一些误解。格林先生:在MPLAB(和MDB)中有一个称为调试器的组件,它处理诸如Run、STEP、HALT、断点等操作。调试器控制真正的ICE、ICD和模拟器等工具,告诉他们在模拟器中运行、步骤、停机等是一个特殊的组件,称为SCL。它负责在模拟器运行时将值注入模拟器(例如设置引脚)。调试器->模拟器-gt;SCL(run,等)(指令)(注入)。我试图指出的是,SCL是从处理停止的组件向下的2个级别。SCL并不打算停止一个工具,但是你仍然可以做你想做的事情,而不是你现在想做的事情。让我们从你可以随时加载一个SCL文件的想法开始。所以你可以1岁。设置断点2。运行直到命中断点3。附加您的SCL文件,设置您的PIN等4。继续运行下一步,在不同时间加载多个SCL文件并做不同的操作是非常好的。最后,可以通过“STIM”命令在MDB中附加SCL文件。MDB也被记录下来,这样您就可以了解如何使用“STIM”命令。您将在MPLAX安装的DOCS子文件夹中再次找到MDB文档。因此您的MDB脚本可能看起来类似B行1运行等待STIM“MyFiels.SCL”运行等待。
以上来自于百度翻译 以下为原文 Let's see if we can dispel some misconceptions here. mr green: Within MPLAB (and MDB) there is a component called the Debugger, which handles operations like run, step, halt, breakpoints, etc. The Debugger controls tools like Real ICE, ICD and simulator, telling them when to run, step, halt, etc. Within the simulator is a special component called SCL that is responsible for injecting values into the simulator (e.g. setting pins) while the simulator is running. Debugger -> Simulator -> SCL (run, etc) (instructions) (injections) The point I'm trying to make is that SCL is 2 levels down from the component that handles halting. SCL isn't intended to halt a tool. But you can still do what you want to do, just not the way you are currently trying to do it. Let's start with the idea that you can load an SCL file any time you want. So you could 1. Set a breakpoint 2. Run until you hit the breakpoint 3. Attach your SCL file that sets your pins etc. 4. Continue running Next, it is perfectly fine to have multiple SCL files that get loaded at different times and doing different things. Finally you can attach SCL files in MDB via the "stim" command. MDB is also documented so you can learn about how to use the "stim" command. You'll find the MDB document, again, in the docs sub folder of your MPLAB X installation. So your MDB script might look something like b line#1 run wait stim "myfile.scl" run wait |
|
|
|
|
|
|
|
这些年来没有人注意到这一点吗?悲哀的是,公平地说,我花了一点时间才明白到底发生了什么。执行摘要是,如果RC5和RC6同时成为“1”,则SCL代码不能工作。(或者,当SCL代码运行时,它们已经是‘1’)。如果RC5在一个周期内变高,随后RC6在以后的周期中变高,则SCL代码将工作。这当然是SCL中的一个错误。但是希望你有足够的信息来解决这个问题吗?
以上来自于百度翻译 以下为原文 All these years and no one has noticed this before?! sad: To be fair, it took me a bit to figure out what was going on. The executive summary is that your SCL code won't work if RC5 and RC6 both become '1' simultaneously. (Or if they are already both '1' when the SCL code is ran.) If RC5 goes high on one cycle and then subsequently RC6 goes high on a later cycle your SCL code will work. This is, of course, a bug in SCL. But hopefully you have enough information to work around until we can get this fixed? |
|
|
|
|
|
|
|
这个问题被证明是困难的,通常是SCL的情况,这是模拟器中最复杂的代码之一。但我会想到MPLAB X 4.05。(MPLAB X 4已经在代码冻结中)没有,此时无法在进程之间共享SCL变量。我将把它添加到我无限长的模拟器改进列表中,以便在退休前实施。但我认为你的想法是正确的,从你的应用程序源代码中使用变量。如果在通用RAM中有一个或多个字,则可以在应用程序中声明变量或两个变量。您可以从SCL代码中执行所有变量的设置和测试。因此,对源代码的唯一影响是使用额外的一个或两个RAM。
以上来自于百度翻译 以下为原文 The problem is proving to be difficult, as is usually the case with SCL, which is some of the most complex code in the simulator. But I would think by MPLAB X 4.05. (MPLAB X 4.0 is already in code-freeze.) No there is no way to share SCL variables between processes at this time. I will add this to my infinitely long list of simulator improvements to implement before I retire. wink: But I think you are on the right track with your idea of using variables from your application source code. If you have an extra word or two in general purpose RAM you can declare a variable or two in your application. You can do all the setting and testing of the variables from within your SCL code. So the only influence on your source code is that you are using an extra word or two of RAM. |
|
|
|
|
|
|
|
|
|
|
|
不幸的是SCL不够聪明,无法处理变量的作用域。使变量全局和SCL都应该看到它。
以上来自于百度翻译 以下为原文 Unfortunately SCL isn't smart enough to handle scoping on variables. Make the variable global and SCL should see it. |
|
|
|
条件等待语句已被纠正。您应该在MPLAB X 4.05中看到修复。
以上来自于百度翻译 以下为原文 conditional wait statement has been corrected. You should see the fix in MPLAB X 4.05. |
|
|
|
|
|
|
|
布尔运算符还没有被实现。存在这样的增强请求。但是布尔运算的缺乏对客户来说并不是一个严重的障碍,所以我们还没有涉足它。
以上来自于百度翻译 以下为原文 Boolean operators have not been implemented yet. There is an existing enhancement request to do so. But the lack of the Boolean operators hasn't been a serious hindrance to customers so we haven't gotten around to it yet. |
|
|
|
叹息。现在我把这个拉回。问题就在这里。您尝试这样做,但它不起作用,因为当执行这个SCL行时,RC6已经等于1。生成的SCL“字节码”将等待RC6在检查条件之前改变值。所以我改变了SCL在进入等待状态之前检查状态的方式,这看起来是个好主意。但是我们在RC6变成1的时候绊倒了,这个SCL过程是无限的。所以我们必须修改代码如下,所以现在我们意识到这种改变可能会破坏现有的SCL代码。(包括许多我们自己的自动化测试!)因此,我将恢复SCL代码以使用它所使用的方式(即,等待值更改,然后检查值)。没有意义打破所有现有的代码。如果可能的情况下,您的条件可能是真实的,然后进入等待语句,你需要这样做。这并不比等待RC6麻烦!=前一个示例中的“1”。但它并没有从现有的SCL用户那里拉出地毯。
以上来自于百度翻译 以下为原文 Sigh. Now I'm pulling this back out. Here's the issue. You were attempting to do this wait until RC6 == '1'; But it didn't work because when this SCL line was executed RC6 was already equal to 1. The generated SCL "byte code" would wait until RC6 had changed value before checking the condition. So I changed the way SCL worked to check the condition before entering the wait state. This seemed like a good idea. But then we tripped over this process is begin wait until RC6 == '1'; report("RC6 was seen to be '1'"); end process; The moment RC6 becomes 1, this SCL process is infinite. So we would have to modify the code as follows. process is begin wait until RC6 == '1'; report("RC6 was seen to be '1'"); wait until RC6 != '1'; end process; So now we realize that this change likely breaks quite a bit of existing SCL code. (Including many of our own automated tests!) So, I'm going to revert the SCL code to work the way it used to (ie, wait for value change then check value). No sense breaking all the existing code. If it is possible that your condition could be true before entering the wait statement you need to do this. if (RC6 != '1') then wait until RC6 == '1'; end if; Which is no less cumbersome than waiting for RC6 != '1' in the previous example. But it doesn't pull the rug out from under the existing SCL users. Sorry for the confusion. |
|
|
|
|
|
|
|
|
|
|
|
布尔和逻辑运算符尚未实现。对于这些特性,有一个长期的增强要求,它已经在我无限长的模拟器列表上移动了相当高的高度。但并不等同于将正式的Atmel器件集成到MPLAB X中。
以上来自于百度翻译 以下为原文 Boolean and logical operators not implemented yet. There is a long standing enhancement request for these features, which has moved fairly high up on my infinitely long list of things to do for the simulator. But not quite as high as integrating formal Atmel devices into MPLAB X. mr green: |
|
|
|
哇,你有(至少)1824行在你的SCL源?你给的SCL代码中的哪一个片段是Lang-x 1824?
以上来自于百度翻译 以下为原文 Wow, you have (at least) 1824 lines in your SCL source?! Which one of the snippets of SCL code you gave is line #1824? |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5243 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3208 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2258 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
681浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 21:07 , Processed in 1.593426 second(s), Total 111, Slave 94 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号