1
0
mirror of https://github.com/wfjm/w11.git synced 2026-04-24 19:40:39 +00:00

Cleanups; 17bit support for tst_sram

- s3_sram_memctl: drop superfluous idata_cei=1 in s_write2
- arty_bram/tb/tbrun.yml: retire mem70 - now in tbcpu
- tst_sram.vhd: allow AWIDTH=17; sstat_rbf_awidth instead of _wide
- tcl/tst_sram/*.tcl: 17bit support; use sstat(awidth); add isnarrow
- rtl/vlib/rutil.vhd: added package, with imin helper function
This commit is contained in:
wfjm
2017-06-25 20:20:48 +02:00
parent 691b95c786
commit 4aa1db49c7
10 changed files with 217 additions and 91 deletions

View File

@@ -1,6 +1,6 @@
-- $Id: s3_sram_memctl.vhd 793 2016-07-23 19:38:55Z mueller $
-- $Id: s3_sram_memctl.vhd 912 2017-06-11 18:30:03Z mueller $
--
-- Copyright 2007-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
-- Copyright 2007-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
@@ -13,7 +13,7 @@
--
------------------------------------------------------------------------------
-- Module Name: s3_sram_memctl - syn
-- Description: s3board: SRAM driver
-- Description: s3board: SRAM controller
--
-- Dependencies: vlib/xlib/iob_reg_o
-- vlib/xlib/iob_reg_o_gen
@@ -30,6 +30,7 @@
--
-- Revision History:
-- Date Rev Version Comment
-- 2017-06-11 912 1.0.8 drop superfluous idata_cei=1 in s_write2
-- 2016-07-23 793 1.0.7 drop "KEEP" for data (better for dbg)
-- 2011-11-19 427 1.0.6 now numeric_std clean
-- 2010-06-03 299 1.0.5 add "KEEP" for data iob;
@@ -83,7 +84,7 @@ use ieee.numeric_std.all;
use work.slvtypes.all;
use work.xlib.all;
entity s3_sram_memctl is -- SRAM driver for S3BOARD
entity s3_sram_memctl is -- SRAM controller for S3BOARD
port (
CLK : in slbit; -- clock
RESET : in slbit; -- reset
@@ -311,7 +312,6 @@ begin
when s_write2 => -- s_write2: write cycle, 2nd half
iactw := '1'; -- signal mem write
iackw := '1'; -- signal write acknowledge
idata_cei := '1'; -- latch input data (from SRAM)
if REQ = '1' then -- if IO requested
if WE = '1' then -- if WRITE requested
iaddr_ce := '1'; -- latch address and be's

View File

@@ -1,5 +1,6 @@
# libs
../../vlib/slvtypes.vhd
../../vlib/rutil.vhd
../../vlib/memlib/memlib.vhd
../../vlib/rbus/rblib.vhd
${sys_conf}

View File

@@ -1,6 +1,6 @@
-- $Id: tst_sram.vhd 889 2017-04-30 13:31:27Z mueller $
-- $Id: tst_sram.vhd 917 2017-06-25 18:05:28Z mueller $
--
-- Copyright 2007-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
-- Copyright 2007-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
@@ -13,22 +13,24 @@
--
------------------------------------------------------------------------------
-- Module Name: tst_sram - syn
-- Description: test of s3board sram and its controller
-- Description: test of sram (s3,c7) and cram (n2,n3,n4) and its controller
--
-- Dependencies: vlib/memlib/ram_1swsr_wfirst_gen
-- vlib/memlib/ram_2swsr_wfirst_gen
-- vlib/rlink/rlink_base_serport
--
-- Test bench: nexys4/tb/tb_tst_sram_n4 (with cram)
-- Test bench: cmoda7/tb/tb_tst_sram_c7 (with sram)
-- nexys4/tb/tb_tst_sram_n4 (with cram)
-- nexys3/tb/tb_tst_sram_n3 (with cram)
-- nexys2/tb/tb_tst_sram_n2 (with cram)
-- s3board/tb/tb_tst_sram_s3 (with sram)
--
-- Target Devices: generic
-- Tool versions: xst 8.2-14.7; viv 2014.4-2016.2; ghdl 0.18-0.33
-- Tool versions: xst 8.2-14.7; viv 2014.4-2017.1; ghdl 0.18-0.34
--
-- Revision History:
-- Date Rev Version Comment
-- 2017-06-25 917 1.6 allow AWIDTH=17; sstat_rbf_awidth instead of _wide
-- 2016-07-10 785 1.5.1 std SWI layout: now (7:4) disp select, SWI(1)->XON
-- 2016-07-09 784 1.5 AWIDTH generic, add 22bit support for cram
-- 2016-05-22 767 1.4.1 don't init N_REGS (vivado fix for fsm inference)
@@ -153,11 +155,14 @@
-- DP(0): SER_MONI.rxact (shows rx activity)
--
-- ----------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.slvtypes.all;
use work.rutil.all;
use work.memlib.all;
use work.rblib.all;
@@ -194,6 +199,8 @@ entity tst_sram is -- tester for sram memctl
end tst_sram;
architecture syn of tst_sram is
constant IWIDTH : natural := imin(18, AWIDTH);
signal SEQ_RESET : slbit := '0';
@@ -284,7 +291,7 @@ architecture syn of tst_sram is
subtype maddr_f_wh is integer range AWIDTH-1 downto 16;
subtype maddr_f_wl is integer range 15 downto 0;
subtype maddr_f_scmd is integer range 17 downto 0;
subtype maddr_f_scmd is integer range IWIDTH-1 downto 0;
subtype maddr_f_top4 is integer range AWIDTH-1 downto AWIDTH-1-3;
subtype maddr_f_mid4 is integer range AWIDTH-1-4 downto AWIDTH-1-7;
subtype maddr_f_bot is integer range AWIDTH-1-8 downto 0;
@@ -300,7 +307,7 @@ architecture syn of tst_sram is
subtype mcmd_rbf_be is integer range 11 downto 8;
subtype mcmd_rbf_addrh is integer range AWIDTH-1-16 downto 0;
constant sstat_rbf_wide: integer := 15;
subtype sstat_rbf_awidth is integer range 15 downto 13;
constant sstat_rbf_wswap: integer := 9;
constant sstat_rbf_wloop: integer := 8;
constant sstat_rbf_loop: integer := 7;
@@ -313,7 +320,7 @@ architecture syn of tst_sram is
subtype scmd_rbf_wait is integer range 31 downto 28;
constant scmd_rbf_we: integer := 24;
subtype scmd_rbf_be is integer range 23 downto 20;
subtype scmd_rbf_addr is integer range 17 downto 0;
subtype scmd_rbf_addr is integer range IWIDTH-1 downto 0;
constant rbaddr_mdih: slv5 := "00000"; -- 0 -/r/w
constant rbaddr_mdil: slv5 := "00001"; -- 1 -/r/w
@@ -354,8 +361,8 @@ architecture syn of tst_sram is
begin
assert AWIDTH=18 or AWIDTH=22
report "assert(AWIDTH=18 or AWIDTH=22): unsupported AWIDTH"
assert AWIDTH=17 or AWIDTH=18 or AWIDTH=22
report "assert(AWIDTH=17 or AWIDTH=18 or AWIDTH=22): unsupported AWIDTH"
severity failure;
SMEM_B3 : ram_1swsr_wfirst_gen
@@ -1023,9 +1030,7 @@ begin
omux_dat(r.saddr'range) := r.saddr;
when omux_sstat =>
omux_dat := (others=>'0');
if AWIDTH = 22 then
omux_dat(sstat_rbf_wide) := '1';
end if;
omux_dat(sstat_rbf_awidth):= slv(to_unsigned(AWIDTH-16,3));
omux_dat(sstat_rbf_wswap) := r.swswap;
omux_dat(sstat_rbf_wloop) := r.swloop;
omux_dat(sstat_rbf_loop) := r.sloop;

View File

@@ -1,7 +1,8 @@
# $Id: tbrun.yml 809 2016-09-18 19:49:14Z mueller $
# $Id: tbrun.yml 916 2017-06-25 13:30:07Z mueller $
#
# Revision History:
# Date Rev Version Comment
# 2017-06-25 916 1.1 retire mem70 - now in tbcpu
# 2016-09-18 809 1.0.1 use 60 sec tout for run_pdpcp tb_pdp11core_stim
# 2016-08-21 799 1.0 Initial version
#
@@ -13,11 +14,6 @@
tbrun_tbwrri --hxon --lsuf stim1 tb_w11a_br_arty${ms} \
"rlink::run_rri ../../../../w11a/tb/tb_rlink_tba_pdp11core_stim.dat"
- tag: [default, viv, sys_w11a, br_arty, mem70]
test: |
tbrun_tbwrri --hxon --lsuf mem70 --pack rw11 tb_w11a_br_arty${ms} \
"rw11::setup_cpu" "rw11::run_pdpcp ../../tb/tb_w11a_mem70.dat"
- tag: [default, viv, sys_w11a, br_arty, stim2]
test: |
tbrun_tbwrri --hxon --lsuf stim2 --pack rw11 tb_w11a_br_arty${ms} \

41
rtl/vlib/rutil.vhd Normal file
View File

@@ -0,0 +1,41 @@
-- $Id: rutil.vhd 917 2017-06-25 18:05:28Z mueller $
--
-- Copyright 2017- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
--
-- This program is free software; you may redistribute and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 2, or at your option any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for complete details.
--
------------------------------------------------------------------------------
-- Package Name: rutil
-- Description: Miscellaneous helper functions
--
-- Dependencies: -
-- Tool versions: ise 14.7; viv 2017.1; ghdl 0.34
-- Revision History:
-- Date Rev Version Comment
-- 2017-06-25 44 1.0 Initial version
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package rutil is
function imin (left, right: integer) return integer;
end package rutil;
package body rutil is
function imin (left, right: integer) return integer is
begin
if left < right then
return left;
else
return right;
end if;
end imin;
end package body rutil;