もしかして
q <= d when clk'event and clk='1';
なんてのもありなのか?
今度試してみるかな。