gateware/sysmgr: Make sure sys_start _always_ forces system clock ON

Before it was only sensitive to rising edge. But for the "start" we
actually want to force it on if active to avoid race condition in the
software where:

- CPU clears the condition of the wakeup
- New wake up event happens right after it
- CPU asks for shutdown
- And then no rising edge happens because wakeup is already high

For shutdown it's good that it's rising edge dependent since the
OFF command signal _might_ stay high if the system clock shuts down

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2023-03-12 22:41:48 +01:00
parent 27f35141de
commit b2d95779c6
3 changed files with 6 additions and 6 deletions

View File

@ -176,8 +176,8 @@ module sysmgr (
// Synch triggers
always @(posedge clk_base)
begin
sys_start_s <= { ~sys_start_s[1] & sys_start_s[0], sys_start_s[0], sys_start };
sys_stop_s <= { ~sys_stop_s[1] & sys_stop_s[0], sys_stop_s[0], sys_stop };
sys_start_s <= { sys_start_s[1], sys_start_s[0], sys_start };
sys_stop_s <= { ~sys_stop_s[1] & sys_stop_s[0], sys_stop_s[0], sys_stop };
end
always @(posedge clk_base)

View File

@ -170,8 +170,8 @@ module sysmgr (
// Synch triggers
always @(posedge clk_base)
begin
sys_start_s <= { ~sys_start_s[1] & sys_start_s[0], sys_start_s[0], sys_start };
sys_stop_s <= { ~sys_stop_s[1] & sys_stop_s[0], sys_stop_s[0], sys_stop };
sys_start_s <= { sys_start_s[1], sys_start_s[0], sys_start };
sys_stop_s <= { ~sys_stop_s[1] & sys_stop_s[0], sys_stop_s[0], sys_stop };
end
always @(posedge clk_base)

View File

@ -166,8 +166,8 @@ module sysmgr (
// Synch triggers
always @(posedge clk_base)
begin
sys_start_s <= { ~sys_start_s[1] & sys_start_s[0], sys_start_s[0], sys_start };
sys_stop_s <= { ~sys_stop_s[1] & sys_stop_s[0], sys_stop_s[0], sys_stop };
sys_start_s <= { sys_start_s[1], sys_start_s[0], sys_start };
sys_stop_s <= { ~sys_stop_s[1] & sys_stop_s[0], sys_stop_s[0], sys_stop };
end
always @(posedge clk_base)