Browse Source

tests on lab

pull/2/head
Raniita 3 years ago
parent
commit
1aef032f66
  1. 33
      _impact.cmd
  2. 110
      toplevel.vhd

33
_impact.cmd

@ -0,0 +1,33 @@
setMode -bs
setMode -bs
setMode -bs
setMode -bs
setCable -port auto
Identify -inferir
identifyMPM
assignFile -p 1 -file "/home/rani/Desktop/git/picoblaze-lab/toplevel.bit"
Program -p 1
setMode -bs
setMode -bs
setMode -ss
setMode -sm
setMode -hw140
setMode -spi
setMode -acecf
setMode -acempm
setMode -pff
setMode -bs
saveProjectFile -file "/home/rani/Desktop/A_Hardware/P2a-picoblaze-helloworld/hello-world//auto_project.ipf"
setMode -bs
setMode -bs
deleteDevice -position 1
deleteDevice -position 1
deleteDevice -position 1
setMode -bs
setMode -ss
setMode -sm
setMode -hw140
setMode -spi
setMode -acecf
setMode -acempm
setMode -pff

110
toplevel.vhd

@ -167,7 +167,7 @@ begin
process(clk,reset)
-- Variable para los colores. CARGA INSTANTANEA DEL VALOR, SOLO PARA USO TEMPORAL!!
variable clock_25 : std_logic := '0';
variable RGB : std_logic_vector(2 downto 0) := (others => '0');
variable RGB : std_logic_vector(2 downto 0);
variable x : integer;
variable y : integer;
variable rowData : std_logic_vector(0 to 7) := (others => '0');
@ -187,114 +187,18 @@ begin
else
if clock_25 = '1' then
-- Si estamos dentro del rango de display y la pantalla esta lista para sacar cosas
if (ready = '1' AND xCount < 640 AND yCount < 480) then
if (ready = '1' AND xCount >= 0 AND xCount < 640 AND yCount >= 0 AND yCount < 480) then
-- ## LO QUE EJECUTAMOS EN CADA FRAME ## --
-- Default color como black
RGB := (others => '0');
if xCount < border_width * 8 OR xCount > 639 - (border_width * 8) OR
yCount < (border_width * 8) OR yCount > 479 - (border_width * 8) then
RGB := BLUE;
end if;
-- Por si queremos dibujar ms mierda va aqui
if(writestrobe = '1' AND portid=x"FE") then
case outport is
when x"64" =>
-- Recibimos ascii d
-- Movemos derecha?
cube_x_min <= cube_x_min+1;
cube_x_max <= cube_x_max+1;
cube_y_min <= cube_y_min;
cube_y_max <= cube_y_max;
when x"61" =>
-- Recibimos ascii a
-- Movemos izquierda?
cube_x_min <= cube_x_min-1;
cube_x_max <= cube_x_max-1;
cube_y_min <= cube_y_min;
cube_y_max <= cube_y_max;
when x"77" =>
-- Recibimos ascii w
-- Movemos arriba?
cube_x_min <= cube_x_min;
cube_x_max <= cube_x_max;
cube_y_min <= cube_y_min-1;
cube_y_max <= cube_y_max-1;
when x"73" =>
-- Recibimos ascii s
-- Movemos abajo?
cube_x_min <= cube_x_min;
cube_x_max <= cube_x_max;
cube_y_min <= cube_y_min+1;
cube_y_max <= cube_y_max+1;
when others =>
cube_x_min <= cube_x_min;
cube_x_max <= cube_x_max;
cube_y_min <= cube_y_min;
cube_y_max <= cube_y_max;
end case;
end if;
if(xCount>=cube_x_min AND xCount<cube_x_max AND
yCount>=cube_y_min AND yCount<cube_y_max) then
RGB := "0" & "1" & "1";
end if;
-- Write current character
-- Get nearest valid char position using magic division/multiplication decimal crush
terminal_column := xCount / 8 ;
char_start_x := terminal_column * 8;
char_end_x := char_start_x + 8;
terminal_row := yCount / 16;
char_start_y := terminal_row * 16;
char_end_y := char_start_y + 16;
if xCount >= char_start_x AND xCount < char_end_x AND yCount >= char_start_y AND yCount < char_end_y
AND terminal_column < (WORDS_ROM'LENGTH + border_width)
AND terminal_column > border_width - 1 AND terminal_column < 80 - border_width
AND terminal_row > border_width - 2 AND terminal_row <= 30 - border_width then
x := (xCount - char_start_x) mod 8;
y := (yCount - char_start_y) mod 16;
--addrA <= y+16*1;
--rowData := dataOutA;
rowData := font_ROM(y + 16 * WORDS_ROM(terminal_column - border_width));
if rowData(x) = '1' then
RGB := WHITE;
end if;
end if;
-- Prueba de todos los colores. Rayas de 2px de arriba a abajo.
-- if xCount >= 310 AND xCount < 312 then
-- RGB := "0" & "0" & "1";
-- elsif xCount >= 312 AND xCount < 314 then
-- RGB := "0" & "1" & "0";
-- elsif xCount >= 314 AND xCount < 316 then
-- RGB := "0" & "1" & "1";
-- elsif xCount >= 316 AND xCount < 318 then
-- RGB := "1" & "0" & "0";
-- elsif xCount >= 318 AND xCount < 320 then
-- RGB := "1" & "0" & "1";
-- elsif xCount >= 320 AND xCount < 322 then
-- RGB := "1" & "1" & "0";
-- elsif xCount >= 322 AND xCount < 324 then
-- RGB := "1" & "1" & "1";
-- end if;
-- Cuadrado de un color?
-- if xCount >=100 AND xCount < 130 then
-- if yCount >= 20 AND yCount < 30 then
-- RGB := "1" & "1" & "0";
-- end if;
-- end if;
-- ## FIN DE LO QUE EJECUTAMOS EN CADA FRAME ## --
elsif (xCount < 500) then
RGB := WHITE;
else
RGB := YELLOW;
end if;
-- Sacamos los colores por los puertos de la FPGA
R <= RGB(2);

Loading…
Cancel
Save