aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/python-console/data/test5.py
blob: 1f80c9984b15984b87c314257551dbd651953b14 (plain)
1
2
3
for i in range(2):
    for j in range(3):
        print i, j
*/ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
------------------------------------------------
--!  Test intent : Procedure calls with signals parameters.
--!  Test scope  : Checking activity with  'active
--!  Keywords    : [procedure, parameters, signal]
--!  References  : [VH2000 1.1:]
--!                [Rlink REQ00:2.1.1.2.1]
--!                [Rlink REQ00:2.1.1.2.4]
--
-------------------------------------------------
--  'active 
-- 
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use work.subs_pkg.all;
use work.proc_pkg.all;
use work.all;

entity pf7 is
end entity;

architecture tb of pf7 is

  signal tclk : std_logic := '0';
  signal trst : std_logic := '0';
  signal tper : integer := 1;
  
  signal u1_in:  std_logic_vector(7 downto 0);
  signal u1_out: std_logic_vector(7 downto 0);
  signal u2_in:  std_logic_vector(7 downto 0);
  signal u2_out: std_logic_vector(7 downto 0);
  
  signal gen_out : std_logic_vector(15 downto 0);
  
  signal mems : arr_marr_t;
  
  signal mem_if_in : ctl_if_t;
  signal mem_if_out : rsp_if_t;
  signal mon_if_in : ctl_if_t;
  signal mon_if_out : rsp_if_t;
  signal ackm : std_logic;
  
  signal sig_act : boolean;

begin

  act_mon(mem_if_in, mem_if_out, sig_act);

  process(mem_if_in)
  begin
    for i in mem_if_in.d1'range loop
      if mem_if_in.d1(i)'active then
        report "Bit : " & integer'image(i) & " is active";
      end if;
    end loop;
  end process;

  -- clock
  clock: process
  begin
    tclk <= '0';
    wait for 1 ns;
    tclk <= '1';
    wait for 1 ns;
  end process;
  
  sim_ctl: process
    variable v_cnt : integer := 0;
  begin
    while v_cnt < 5 loop
      v_cnt := v_cnt + 1;
      --report "Tick ...";
      wait until tclk'event and tclk = '1';
    end loop;
    report "Passed, END SIM ..." severity failure;
  end process;

  -- generate some data
  dgen: process(tclk)
    variable vec : bit_vector(15 downto 0) := (others => '1');
  begin
    if tclk'event and tclk = '1' then
      vec := klsfr(vec);
      --report bv2str(vec);
      gen_out <= to_stdlogicvector(vec);
      u1_in  <= to_stdlogicvector(vec(7 downto 0));
      u2_in  <= to_stdlogicvector(vec(15 downto 8));
    end if;
  end process;

  --  memory access process
  mem_acc: process
    variable addr : std_logic_vector(15 downto 0) := (others => '0');
    variable idx : integer;
    variable  init : integer := 0;
    variable v_tmp_dat : std_logic_vector(63 downto 0);
  begin
    if init = 0 then
      for i in 3 downto 0 loop
        for j in marr_t'range loop
          mems(i)(j) <= (others => '0');
          wait for 0 ps;
        end loop;
      end loop;
      report "Done.";
      wait for 0 ps;
      for i in 3 downto 0 loop
        for j in marr_t'range loop
          assert kslv2int(mems(i)(j)) = 0 
            report "ERROR: Ram not initialized"
            severity failure;
        end loop;
      end loop;
      mem_if_in.d1 <= (others => '0');
      init := 1;
      
    elsif tclk'event and tclk = '1' then
      mem_access(mem_if_in, mem_if_out, mems, ackm);
      mem_if_in.wr <= '0';
      mem_access(mem_if_in, mem_if_out, mems, ackm);
      --report "Active Drive state: " & slv2str(active_bits(mem_if_out.do));
      --report "Inactive outputs Drive state: " & slv2str(active_bits(mem_if_out.do1));
      wait for 0 ps;
      --report "Inactive Drive state: " & slv2str(active_bits(mem_if_out.do));
      --report "Data: " & slv2str(mem_if_out.do);
      if now > 2 ns then
        assert v_tmp_dat(63 downto 16) = mem_if_out.do(63 downto 16)
          report "Error:  data missmatch on read ..."
          severity failure;
      end if;
    elsif tclk'event and tclk = '0' then
      mem_if_in.a1 <= addr;
      mem_if_in.wr <= '1';
      addr := addr + 16#0001#;
      --report "Address: " & slv2str(addr);
      mem_if_in.di <= gen_out & gen_out(7 downto 0) & gen_out(15 downto 8) & gen_out & gen_out;
      v_tmp_dat := gen_out & gen_out(7 downto 0) & gen_out(15 downto 8) & gen_out & gen_out;
      
      -- generate events on ctl.d1
      wait for 2 ps;
      if now > 2 ns then
        for i in mem_if_in.d1'range loop
          mem_if_in.d1(i) <= not mem_if_in.d1(i);
          wait for 0 ps;
        end loop;
        report slv2str(mem_if_in.d1);
      end if;
    end if;
    wait on tclk;
  end process;

end tb;