I wrote a synchronous BCD counter. The counter count from 0 to 9, and so on and I want to see the signals (inputs & outputs) in ModelSim to verify the code I wrote.
So how can i see the signals?
Do I need to add something to my code or I need to run some function in ModelSim?
thanks,
Aviv
Suppose you have stored the source code of BCD counter and it's testbench in same file. (Let it be BCDcounter.v)
Then you just right click on BCDcounter.v and click compile.
Then if compilation was successful you will right click again the file(the name of the testbench file suppose it is BCDtestbench) and click simulate.
Then a new window will appear. Now in the left pane you will see the same filename that you simulated. Right click on that and select Add to ->Add to wave-> All items in design. Then run it.
Note: you may want to set the run-length appropiately.
Related
How to click on a button called Unlock from the label text LE SR Home notour. I'm new to this tool and got stuck here.
Oddly, your screenshot shows two Unlock buttons, but your debug only shows one.
Going from your debug output, assuming there is only a single unlock button in the application, you simply need to provide the label.
app.buttons["Unlock"].tap()
If there are multiple buttons matched, you need to associate it with the label and find their shared parent. This only works if the parent container isn't shared with the other Unlock button.
app.otherElements.containing(.staticText, identifier: "LE SR Home notour:").lastMatch.buttons["Unlock"].tap()
OR assume its index. If it's the first one on the page firstMatch is what you're looking for.
app.buttons["Unlock"].firstMatch.tap()
If it's not the first you can return an array of all elements (allElementsBoundByIndex) and then choose the index of the one you want. To find the second (arrays begin at 0), for example:
app.buttons["Unlock"].element(boundBy: 1).tap()
or
app.buttons["Unlock"].allElementsBoundByIndex[1].tap()
The best solution is for you or your development team add an accessibility identifer to this button so it can be uniquely identified.
New to VHDL, familiarizing myself with everything.
I got my FPGA to turn on an LED when the button is pressed (code below), but the button has to be held down for the LED to stay on. I would like the LED to turn and stay on when the button is pushed and released (and turned off when pressed again) but I'm confused on how this is done.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity ButtonLED is Port (BUTTON: in STD_LOGIC:='1';
LED : out STD_LOGIC:='0');
end ButtonLED;
architecture Behavioral of ButtonLED is
begin
LED <= not BUTTON;
end Behavioral;
(Warning: I am not giving you the answer. I am only addressing your question on "how it is done")
The statement LED <= not BUTTON defines that the LED is directly connected to the BUTTON through an inverting element. Therefore, your LED will always follow the opposite current state of the BUTTON. If BUTTON is in high logic level, then LED will be set to a low logic level, and vice versa.
I would like the LED to turn and stay on when the button is pushed and released (and turned off when pressed again) but I'm confused on how this is done.
For implementing this feature you must be capable of (1) detecting whenever the button is pressed and released, and (2) to "save" the current state of your LED. Detecting the button "movement" is simply detecting a change in state from high to low, and low to high. As mentioned in the comments it is also important to insert a de-bouncer mechanism between your edge detector and the button. Since FPGA buttons are very sensitive, the de-bouncer will ensure that you won't interpret glitches/noises as an actual press. I advise you to check it out yourself, implementation a version with and without the de-bouncer. Depending on how you press your button you may see the LED toggling multiple times when your hardware doesn't filter the input.
Once you know how to detect when the button was pressed and released, you have to simply add a memory element that toggles every time your condition is met. Now, instead of using LED <= not BUTTON, you'll have an internal variable that will control the LED behavior (i.e., LED <= led_state). This internal variable can be controlled through a process that is sensitive to your edge detection "module". Moreover, this variable will ensure your LED state only changes when your condition is met (i.e., pressing and releasing the button), instead of following the BUTTON inverse state.
Hope this gives you a general overview of your solution.
I have created a GUI in AHK and it works well now. I am processing multiple records and would like to be able to track the place that I am on. My code loops through each record and does some actions before moving on to the next one. While this is happening the GUI window is shown. Also I am writing this in AHK then using the conversion tool and creating an .exe with it. I am developing this tool to be distributed as a stand alone EXE that one can install/save and then run when they want to. Below is a screen shot of the tool and the code to load in the names.
Gui, PasteGUI:Add, Text,, Please add the Names that you want to Process.
Counter := 0
Loop, parse, Clipboard, `n, `r
{
x%A_Index% := A_LoopField
Counter++
}
Counter--
Loop, %Counter% ; Dynamic List length
Gui PasteGUI:Add, Edit, vButton%A_Index%, % x%A_Index%
Gui PasteGUI:Add, Button, x200 y270 w88 h26 vButton02 gGoCont Default, Continue
Gui PasteGUI:Add, Button, x290 y270 w88 h26 vButton03 gGoQuit, Cancel
Gui, PasteGUI:Show
}
Return
GoCont:
{
Loop, %Counter%
{
CODE TO PROCESS MY EACH NAME
}
MsgBox Done!
Gui Destroy
}
Return
GoQuit:
Gui Destroy
Return
I want to add something so that when I am processing Jason it can be identified. Having an arrow that moves as I loop through the list would be nice. As I have depicted it below,I drew it on in paint. Otherwise if I could turn the past records a color that would work too. So for the below example the names "Chris" & "Ben" would be highlighted in a color or the boxes would be somehow identified as different. I am not sure how to do either so it would be great to learn both if possible. Lastly, whatever method is described I need to be able to convert it to an .exe with Ahk2Exe and then be able to run the .exe and not have a need to have any further files or other references in the program that would not work. This is interned to be run on a standard Windows computer so if there are some default images that can be accessed that might be useful too.
Okay so Ive worked out how to do this with PGilm's method of checkboxes. You could also possibly do this with a table of some sort. But the code below looks to be working for me.
Also I wanted to let you know I changed the var x to cliparray so it is easier to read.
Gui, Add, Text,section, Please add the Names that you want to Process.
Counter := 0
Loop, parse, Clipboard, `n, `r
{
cliparray%A_Index% := A_LoopField
Counter++
}
Counter--
Loop, %Counter% {
; Dynamic List length
Gui, Add, Checkbox, xs vCheckBox%A_Index%
Gui Add, Edit, yp+1 xs+30 vTextbox%A_Index%, % cliparray%A_Index%
}
Gui Add, Button, x200 y270 w88 h26 gGoCont vButton02 Default, Continue
Gui Add, Button, x290 y270 w88 h26 vButton03 gGoQuit, Cancel
Gui, Show
Return
GoCont:
;needed to get the variables from the edits and check box, else the varibles dont exist See below for more information.
Gui, Submit, NoHide
msgbox, Go..
Loop, %Counter%
{
line=Textbox%A_Index%
GuiControl,, CheckBox%A_Index%, 1
backone:=A_Index-1
GuiControl,, CheckBox%backone%, 0
Msgbox % "variable " line " contains: " Textbox%A_Index%
}
MsgBox Done!
Return
GoQuit:
Gui Destroy
Return
;Used to debug to see list of all variables. Super helpful :D
F7::
ListVars
return
Some logic to take note of would be on the lines that add the edits and checkbox's. I used the Section logic of Gui positioning to make the edit and check on the same line. In this code the section element is set in the first Gui, Add, for the text section. And thus carries down to the other gui elements. Section AHK Documentation
Gui, Add, Checkbox, xs vCheckBox%A_Index%
Gui Add, Edit, yp+1 xs+30 vTextbox%A_Index%, % cliparray%A_Index%
The next part to take a closer look at is in the GoCont function. I am using the index of the loop to check the CheckBox%A_Index% checkbox so that the current line turns on. I also turn off the last index's check box with the GuiControl,, CheckBox%backone%, 0 line. This give the effect of the check box moving through list as you process text with in each element.
One last line to mention is the Gui, Submit, NoHide. Without this you will be missing the variables created for each checkbox and edit. This will create and fill the variables with the data from each gui element. Gui, Submit AHK Documentation
I'm new to ApplescriptObjC as you'll probably see if you keep reading. I was wondering how to get constant feedback from a slider so that as soon as its value is 1 it runs script A and as soon as its value is changed to 0, it runs script B.
I know you can have actions for buttons like:
on buttonClicked_(sender)
do action
end buttonClicked_
But how can I have a one that constantly checks for a change in the slider's value and does the appropriate action? Is it similar to connecting a slider to a text box with the getStringValueFrom() thing?
Any help would be appreciated. Thanks :)
Found out how!
turns out on action_(sender) will work for sliders as well. They send the signal every time the item is clicked on and released whether a change exists or not. Then its a simple matter of an if statement to run two different series of actions depending on the value the slider was set to.
In AS400,is it possible to have a drop down menu within a display file "RECORD" type record format.
I have created a menu that is written in CL program and invokes the respective
RPG programs for each option selected.
But for one of the options i would further like to open up a menu,a sub menu rather on the same screen(like a drop down).I am aware of a record type of drop down in display...but how do i invoke that through CL i am unsure.
Please help folks.
One displays the window record format the same way one displays the main record format. SNDRCVF (or with a SNDF followed by a RCVF). CL doesn't allow for subfiles, but aside from that, there isn't any special technique to work with a window record format in CL. I know that this sounds very theoretical, but it is the best that I can do without seeing the code you tried.
0000.01 WELCOMEQQ,1
0000.10 0001 WRKMBRPDM
0000.11 0002 GO MENU(GIRRAJ111/MENU#1)
0000.12 0003 GO MENU(QGPL/GUEST)
0000.13 0004 GO MENU(QGPL/GUEST)
0000.14 0011 signoff
here welcomeqq is my first menu
and here MENU#1,GUEST these my secondary Menu which is the optin of first menu
{ Finally you should use "GO MENU(library name/menu name)" this command behind ur opt.}
Since this needs to be implemented using CL, one possible option you can try, is using indicators and switching the option line on/off accordingly which will be in the same record.
Well there can be a hidden flaw, all options are always on (unless you declare the fields with particular values you want to receive), just that it is hidden (if the user type a hidden option that too gets triggered)