我有此功能(可以正常使用)
architecture behav of test is
signal sig : std_logic_vector(15 downto 0) := x"2224";
signal index : integer;
function finding_first_one (signal a : std_logic_vector()) return integer is
begin
for i in a'low to a'high loop
if a(i) = '1' then
return i;
end if;
end loop;
-- all zero
return -1;
end function;
begin
process (CLK)
begin
if rising_edge(clk) then
index <= finding_first_one(sig);
end if;
end process;
end architecture;
当我直接调用function problem_open -e on_problem_open -d "select from existing problems"
set matches (find $FD_PROB_HOME/ -maxdepth 1 -mindepth 1 -type d ! -name ".git")
if test 1 -eq (count $matches)
if test -d $matches
set -U FD_PROB_CURRENT $matches[1]
echo "chose option 1"
return
end
end
set -g dcmd "dialog --stdout --no-tags --menu 'select the file to edit' 20 60 20 "
set c 1
for option in $matches
set l (basename "$option")
set -g dcmd "$dcmd $c '$l'"
set c (math $c + 1)
end
set choice (eval "$dcmd")
#clear
if test $status -eq 0
echo "edit option $choice"
set -U FD_PROB_CURRENT $matches[$choice]
end
end
时,对话框显示正常。当我通过problem_open
间接调用该函数时,对话框不会显示。
有什么想法为什么会这样?是事件的预期行为吗?
我可以解决此问题,但这将是一个谨慎的黑客。