OpenCores
URL https://opencores.org/ocsvn/tinycpu/tinycpu/trunk

Subversion Repositories tinycpu

[/] [tinycpu/] [trunk/] [src/] [memory.vhd] - Diff between revs 37 and 38

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 37 Rev 38
Line 79... Line 79...
      datawrite <= x"0000";
      datawrite <= x"0000";
      we <= "00";
      we <= "00";
    end if;
    end if;
  end process;
  end process;
 
 
  assignram: process (we, datawrite, addr, r1out, port0, WriteEnable, Address)
  assignram: process (we, datawrite, addr, r1out, port0, WriteEnable, Address, Clock)
  variable tmp: integer;
  variable tmp: integer;
  variable tmp2: integer;
  variable tmp2: integer;
  variable found: boolean := false;
  variable found: boolean := false;
  begin
  begin
    tmp := to_integer(unsigned(addr));
    tmp := to_integer(unsigned(addr));
    tmp2 := to_integer(unsigned(Address));
    tmp2 := to_integer(unsigned(Address));
    if tmp2 <= 15 then --internal registers/mapped IO
    if tmp2 <= 15 then --internal registers/mapped IO
 
      if rising_edge(Clock) then
      if WriteWord='0' then
      if WriteWord='0' then
        if tmp2=0 then
        if tmp2=0 then
          dataread <= x"0000";
          dataread <= x"0000";
 
 
          gen: for I in 0 to 7 loop
          gen: for I in 0 to 7 loop
            if WriteEnable='1' then
            if WriteEnable='1' then
              if port0we(I)='1' then --1-bit port set to WRITE mode
              if port0we(I)='1' then --1-bit port set to WRITE mode
                port0(I) <= DataIn(I);
                port0(I) <= DataIn(I);
                port0temp(I) <= DataIn(I);
                port0temp(I) <= DataIn(I);
Line 123... Line 125...
        else
        else
          --synthesis off
          --synthesis off
          report "Memory address is outside of bounds of RAM and registers" severity warning;
          report "Memory address is outside of bounds of RAM and registers" severity warning;
          --synthesis on
          --synthesis on
        end if;
        end if;
 
 
      else
      else
        --synthesis off
        --synthesis off
        report "WriteWord is not allowed in register area. Ignoring access" severity warning;
        report "WriteWord is not allowed in register area. Ignoring access" severity warning;
        --synthesis on
        --synthesis on
      end if;
      end if;
 
      end if;
 
      R1en <= '0';
 
      R1we <= "00";
 
      R1in <= x"0000";
 
      R1addr <= x"00";
    elsif tmp >= R1START and tmp <= R1END then --RAM bank1
    elsif tmp >= R1START and tmp <= R1END then --RAM bank1
      --map all to R1
      --map all to R1
      found := true;
      found := true;
      R1en <= '1';
      R1en <= '1';
      R1we <= we;
      R1we <= we;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.