Why RISCV choose "push and pop" RAS for coroutines? - cpu-architecture

In riscv-spec-2.2, it provide the following truth table for Return Address Stack (RAS) behavior:
rd rs1 rs1=rd RAS action
!link !link - none
!link link - pop
link !link - push
link link 0 push and pop
link link 1 push
I'm confused about the "push and pop" case, where riscv-spec-2.2 says it's used to support coroutines:
When two different link registers (x1 and x5) are given as rs1 and rd, then the RAS is both pushed and popped to support coroutines"
I also found there is a discussion about the RAS truth table in riscv mailing list, but it didn't explain why "push and pop" for RAS could help coroutines (but it mentioned that Alpha also have this kind of hint for coroutines):
https://groups.google.com/a/groups.riscv.org/d/msg/isa-dev/uZUTszCtgAA/f3jDhbjEAAAJ
In my understanding, a "push and pop" of RAS will replace the top entry of RAS. Therefore, when the software returning from coroutine, there will be a miss-predict since the correct return address (at RAS top entry in the beginning) was replaced. It seems doesn't have any benefit to perform "push and pop" compare to a simple "push".
Why RISCV choose to "push and pop" RAS for coroutines ?

Related

STM32WB : Is it possible to wakeup standby mode via BLE?

I am starting a project using STM32WB MCU. I would like to minimize the power consumption while in sleep, but able to wake it up via BLE command.
From the document AN5071(STM32WB ultra-low-power features overview) it says "Wakeup from this mode can also be performed by the Radio sub-system." But I didn't found any further description or example about the 'Radio sub-system'. Does the 'Radio sub-system' is same as BLE?
The only radio in that part is a bluetooth radio, so yes "Radio sub-system" means "BLE subsystem".
For more details you will have to read the reference manual:
RM0471 for STM32WB50CG/30CE
RM0478 for STM32WB10CC
RM0473 for STM32WB15CC
I got reply from ST employee saying it depends on the model. For STM32WB55 it's not possible to enter standby mode with RF active. Check AN5289.
But for STM32WB15 it is possible. Reference the BLE_HeartRate example in STM32CubeWB example.

Calibrating a touch screen monitor

A friend of mine got me a EloTouchSystems 2216 AccuTouch USB TouchMoitor, if was apart of a POS system they were replacing, and I am trying to calibrate it on Linux Mint. I have downloaded the xinput_calibrater app and ran it. Here the output from the program:
Calibrating standard Xorg driver "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface"
current calibration values: min_x=0, max_x=65535 and min_y=0, max_y=65535
If these values are estimated wrong, either supply it manually with the --precalib option, or run the 'get_precalib.sh' script to automatically get it (through HAL).
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
Identifier "calibration"
MatchProduct "EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface"
Option "MinX" "5504"
Option "MaxX" "59519"
Option "MinY" "57834"
Option "MaxY" "6123"
Option "SwapXY" "0" # unless it was already set to 1
Option "InvertX" "0" # unless it was already set
Option "InvertY" "0" # unless it was already set
EndSection
I copied the the snippet as directed to the 99-calibration.conf file, and restarted my computer and nothing happened.
I have tried changing the "InvertX" and "InvertY" values to 1 (changing only one at a time) and rebooting after each time with not success. I am at a lose as to what to do. Can someone offer any suggestions, Please.
P.S. The monitor was manufactured by Fujitsu, and I am using the most current version of Linux Mint.
Additional Information: After posting the question, I realized I did not mention what the touch screen was doing. When I touch the screen and move my finger up and down on the screen, the cursor moves in the opposite direction.

Dialogflow, Google Assistant: Getting error "MalformedResponse 'final_response' must be set"

I have three intents, "Cold Exposure", "Poisoning" and "Frostbite". Each intent has suggestion chips to move to the next intent, i.e. the "Cold Exposure" shows a chip of "Poisoning" and "Poisoning" shows a suggestion chip of "Frostbite".
All are follow up intents of the Default Welcome Intent, so all have the "Default Welcome Intent- followup" input context.
My problem is, when I call Cold Exposure and then call Poisoning, there's no problem. However, when I call Cold Exposure and then Poisoning, and then Frostbite, I get an error "MalformedResponse 'final_response' must be set." . Im not able to call any three intents back to back. I really dont know why this is happening.Im using v2 API.
This is the only error I have in my program, so it would be great if this could be solved quick.This is a screenshot of my intents.
What is the lifespan of the "Default Welcome Intent- followup" output context in the Default Welcome Intent?
By default, when you create followup Intents, the output context lifespan set in the root Intent is 2. Each action decrements this count and the context disappears when the count reaches 0.
Try increasing the lifespan (in the grey circle next to the output context name) to something like 10 (or any other number you see fit) and remove it manually when needed in later intents (by setting it as output context with a lifespan of 0).
Florent.
I actually wouldn't have expected that the followup intents would work the way you're trying. They're all followups to the original intent, rather than to each other. So it could be that the lifespan of the original intent's Context has expired by the third one. In this case, it would revert to the Fallback Intent.
But the reason for the error message itself is that you're not sending back a reply. If you're using a fulfillment, it means it isn't sending a reply. If you're not, it could be that the "Frostbite" Intent doesn't have a reply set or that your Fallback Intent doesn't have a reply set.

Switch monitor position in Weston

Is it possible to indicate monitor position in Weston/Wayland?
I have two monitors and been testing the Weston compositor, but I have been unable to indicate which monitor should be the main one (or which one should show the "left part" of the screen).
Checking the weston.ini docs (http://manpages.ubuntu.com/manpages/xenial/en/man5/weston.ini.5.html) I found info about setting resolution, scaling and transform/rotation, but nothing about the position of the monitors.
I have been interested into the same some weeks ago. I send the question to the wayland IRC channel.
You can have a look at:
https://people.freedesktop.org/~cbrill/dri-log/index.php?channel=wayland&highlight_names=&date=2017-12-19
https://people.freedesktop.org/~cbrill/dri-log/index.php?channel=wayland&highlight_names=&date=2017-12-20
Here is the relevant part:
22:31 maggu2810: Is there any change to change the display / output position in weston? I am using three outputs but don't know how to configure which one if left / right of the other one.
22:33 maggu2810: ... chance to change ...
22:35 maggu2810: the output sections in weston.ini currently contains the name, the mode and the scale. I didn't find any "position" option or anything that looks like an option to modify the "order" of the displays.
07:07 pq: maggu2810, yes, not implemented yet, there were indeed some WIP patches in 2016
Perhaps you will be able to post a feature request in their mailing list. I don't think they will look for feature requests on SO ;)

Simulink: Selected signal originates from an unconnected source

I have a bit of an annoyance rather than a major problem, that I would like to tackle. I have a subsystem that creates a bus inside it and outputs it via a Scope. The bus creation is through From tags, that depend on signals from other components.
Now, when I don't have those components, I get a warning saying something like:
Warning: Selected signal 'Compressor' in 'untitled/Pressure/Bus Selector'
originates from an unconnected source signal
entering 'untitled/Output Data/Bus Creator12' at input port 1
It seems there is no way to turn this off in the Diagnostics pane (Connectivity sub-pane or otherwise). It seems it was a bug in very old versions of Matlab, but was fixed in R13, according to these links:
Link 1,
Link 2 (search for "unconnected source signal" on the page)
I'm using 2013a, a full 12 years later. Anyone have more information on how I can turn this warning off?