以下是源程序,高手帮忙看向时序或其他哪里有错的,我怎么调写到sram的数据都不对
process(CLK,keyget) begin if CLK'event and CLK='1' then case state is when st0 => if keyget='0' then LED<='1';state <= st1; else state<=st0;RAM_CS<='1';RAM_WE<='1';RAM_OE<='1';LED<='0'; count<=0;temp<="00000000"; end if; when st1 => if addr="111111111111111" then LED<='0';state <= st0;else addr<=addr+1;temp<=temp+1;state<=st2; --判断是否写完,写完转重录 end if; when st2 => state <= st3;RAM_CS<='0'; --向ram写数据 when st3 => state <= st4;RAM_WE<='0'; when st4 => state <= st5;dataout<=temp; when st5 => state <= st6;dataout<=temp; when st6 => state <= st7;dataout<=temp; when st7 => state <= st8;dataout<=temp; when st8 => state <= st9;RAM_WE<='1'; when st9 => state <= st1;RAM_CS<='1'; END CASE; END IF; END PROCESS;
|