diff --git a/doc/INSTALL.txt b/doc/INSTALL.txt index 64452353..e93775d2 100644 --- a/doc/INSTALL.txt +++ b/doc/INSTALL.txt @@ -1,4 +1,4 @@ -# $Id: INSTALL.txt 376 2011-04-17 12:24:07Z mueller $ +# $Id: INSTALL.txt 408 2011-09-12 19:48:36Z mueller $ Guide to install and build w11a systems, test benches and support software @@ -40,9 +40,12 @@ Guide to install and build w11a systems, test benches and support software (Xilinx xst based) as well as the support software (mainly the rlink backend server) requires - - the definition of the environment variable RETROBASE + - the definition of the environment variables: + - RETROBASE: must refer to the installation root directory + - BOOSTINC: pathname for includes of boost library - that the tools binary directory is in the path - that the tools library directory is in the library path + For bash and alike use @@ -50,6 +53,11 @@ Guide to install and build w11a systems, test benches and support software export PATH=$PATH:$RETROBASE/tools/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RETROBASE/tools/lib + In most cases the boost library version coming with the distribution will + work, in those cases simply use + + export BOOSTINC=/usr/include + After that building functional model based test benches will work. If you want to also build post-xst or post-par test benches read next section. @@ -79,6 +87,14 @@ Guide to install and build w11a systems, test benches and support software 4a. Compile sharable libraries --------------------------------------- + Required tools and libraries: + g++ >= 4.3 (decltype support assumed in usage of boost::bind) + boost >= 1.35 (boost::thread api changed, new one is used) + + Build was tested under: + ubuntu lucid (10.04 LTS): gcc 4.4.3 boost 1.40.0 + debian lenny (5.0.8): gcc 4.3.2 boost 1.xx.x (t.b.c.) + To build all sharable libraries cd $RETROBASE/tools/src @@ -191,7 +207,7 @@ Guide to install and build w11a systems, test benches and support software To load the bitfile with WebPack impact into the target board use - make .impact + make .iconfig If only the xst or par output is wanted just use diff --git a/doc/README.txt b/doc/README.txt index ce1856be..13ebd36e 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -1,4 +1,4 @@ -# $Id: README.txt 376 2011-04-17 12:24:07Z mueller $ +# $Id: README.txt 408 2011-09-12 19:48:36Z mueller $ Release notes for w11a @@ -60,6 +60,34 @@ Release notes for w11a 3. Change Log ---------------------------------------------------------------- +- trunk (2011-09-11: svn rev 12(oc) 408(wfjm); untagged w11a_V0.531) +++++++++ + + - Summary + - Many small changes to prepare upcoming support for + - Spartan-6 boards (nexys3 and atlys) + - usage of Cypress FX2 USB interface on nexys2/3 and atlys boards + - no functional change of w11a CPU core or any test systems + + - Changes + - use boost libraries instead of custom coding: + - boost/function and /bind for callbacks, retire RmethDscBase and RmethDsc + - boost/foreach for some iterator loops + Note: boost 1.35 and gcc 4.3 or newer is required, see INSTALL.txt + - module renames: + bplib/s3board/s3_rs232_iob_int -> bplib/bpgen/bp_rs232_2line_iob + bplib/s3board/s3_rs232_iob_ext -> bplib/bpgen/bp_rs232_4line_iob + bplib/s3board/s3_dispdrv -> bplib/bpgen/sn_4x7segctl + bplib/s3board/s3_humanio -> bplib/bpgen/sn_humanio + bplib/s3board/s3_humanio_rbus -> bplib/bpgen/sn_humanio_rbus + - other renames: + tools/bin/impact_wrapper -> tools/bin/config_wrapper + - reorganize Makefile includes and xflow option files + rtl/vlib/Makefile.ghdl -> rtl/make/generic_ghdl.mk + rtl/vlib/Makefile.isim -> rtl/make/generic_isim.mk + rtl/vlib/Makefile.xflow -> rtl/make/generic_xflow.mk + rtl/vlib/xst_vhdl.opt -> rtl/make/syn_s3_speed.opt + rtl/vlib/balanced.opt -> rtl/make/imp_s3_speed.opt + - trunk (2011-04-17: svn rev 11(oc) 376(wfjm); untagged w11a_V0.53) ++++++++++ - Summary diff --git a/rtl/bplib/bpgen/Makefile b/rtl/bplib/bpgen/Makefile new file mode 100644 index 00000000..14685b7a --- /dev/null +++ b/rtl/bplib/bpgen/Makefile @@ -0,0 +1,25 @@ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ +# +# Revision History: +# Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make +# 2007-12-09 100 1.0.1 drop ISE_p definition +# 2007-09-16 83 1.0 Initial version +# +VBOM_all = $(wildcard *.vbom) +NGC_all = $(VBOM_all:.vbom=.ngc) +# +ISE_PATH = xc3s1000-ft256-4 +# +.PHONY : all clean +# +all : $(NGC_all) +# +clean : ise_clean +# +#---- +# +include $(RETROBASE)/rtl/make/generic_xflow.mk +# +include $(VBOM_all:.vbom=.dep_xst) +# diff --git a/rtl/bplib/bpgen/bp_rs232_2l4l_iob.vbom b/rtl/bplib/bpgen/bp_rs232_2l4l_iob.vbom new file mode 100644 index 00000000..99241c87 --- /dev/null +++ b/rtl/bplib/bpgen/bp_rs232_2l4l_iob.vbom @@ -0,0 +1,8 @@ +# libs +../../vlib/slvtypes.vhd +bpgenlib.vbom +# components +bp_rs232_2line_iob.vbom +bp_rs232_4line_iob.vbom +# design +bp_rs232_2l4l_iob.vhd diff --git a/rtl/bplib/bpgen/bp_rs232_2l4l_iob.vhd b/rtl/bplib/bpgen/bp_rs232_2l4l_iob.vhd new file mode 100644 index 00000000..f2a716fd --- /dev/null +++ b/rtl/bplib/bpgen/bp_rs232_2l4l_iob.vhd @@ -0,0 +1,187 @@ +-- $Id: bp_rs232_2l4l_iob.vhd 406 2011-08-14 21:06:44Z mueller $ +-- +-- Copyright 2010-2011 by Walter F.J. Mueller +-- +-- 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. +-- +------------------------------------------------------------------------------ +-- Module Name: bp_rs232_2l4l_iob - syn +-- Description: iob's for internal + external rs232, with select +-- +-- Dependencies: bp_rs232_2line_iob +-- bp_rs232_4line_iob +-- +-- Test bench: - +-- +-- Target Devices: generic +-- Tool versions: xst 12.1; ghdl 0.26-0.29 +-- +-- Revision History: +-- Date Rev Version Comment +-- 2011-08-14 406 1.2.2 fix mistake in tx and rts relay +-- 2011-08-07 404 1.2.1 add RELAY generic and a relay stage towards IOB's +-- 2011-08-06 403 1.2 add pipeline flops; add RESET signal +-- 2011-07-09 391 1.1 moved and renamed to bpgen +-- 2011-07-02 387 1.0.1 use bp_rs232_[24]line_iob now +-- 2010-04-17 278 1.0 Initial version +------------------------------------------------------------------------------ +-- + +library ieee; +use ieee.std_logic_1164.all; +use ieee.std_logic_arith.all; + +use work.slvtypes.all; +use work.bpgenlib.all; + +-- ---------------------------------------------------------------------------- + +entity bp_rs232_2l4l_iob is -- iob's for dual 2l+4l rs232, w/ select + generic ( + RELAY : boolean := false); -- add a relay stage towards IOB's + port ( + CLK : in slbit; -- clock + RESET : in slbit := '0'; -- reset + SEL : in slbit; -- select, '0' for port 0 + RXD : out slbit; -- receive data (board view) + TXD : in slbit; -- transmit data (board view) + CTS_N : out slbit; -- clear to send (act. low) + RTS_N : in slbit; -- request to send (act. low) + I_RXD0 : in slbit; -- pad-i: p0: receive data (board view) + O_TXD0 : out slbit; -- pad-o: p0: transmit data (board view) + I_RXD1 : in slbit; -- pad-i: p1: receive data (board view) + O_TXD1 : out slbit; -- pad-o: p1: transmit data (board view) + I_CTS1_N : in slbit; -- pad-i: p1: clear to send (act. low) + O_RTS1_N : out slbit -- pad-o: p1: request to send (act. low) + ); +end bp_rs232_2l4l_iob; + +architecture syn of bp_rs232_2l4l_iob is + + signal RXD0 : slbit := '0'; + signal RXD1 : slbit := '0'; + signal CTS1_N : slbit := '0'; + + signal R_RXD : slbit := '1'; + signal R_CTS_N : slbit := '0'; + signal R_TXD0 : slbit := '1'; + signal R_TXD1 : slbit := '1'; + signal R_RTS1_N : slbit := '0'; + + signal RR_RXD0 : slbit := '1'; + signal RR_TXD0 : slbit := '1'; + signal RR_RXD1 : slbit := '1'; + signal RR_TXD1 : slbit := '1'; + signal RR_CTS1_N : slbit := '0'; + signal RR_RTS1_N : slbit := '0'; + +begin + + -- On Digilent Atlys bords the IOBs for P0 and P1 are on diagonally opposide + -- corners of the die, which causes very long (7-8ns) routing delays to a LUT + -- in the middle. The RELAY generic allows to add 'relay flops' between IOB + -- flops and the mux implented in proc_regs_mux. + -- + -- The data flow is + -- iob-flop relay-flop if-flop port + -- RXD0 -> RR_RXD0 -> R_RXD -> RXD + -- TXD0 <- RR_TXD0 <- R_TXD0 <- TXD + -- RXD1 -> RR_RXD1 -> R_RXD -> RXD + -- TXD1 <- RR_TXD1 <- R_TXD1 <- TXD + -- CTS1_N -> RR_CTS1_N -> R_CTS_N -> CTS + -- RTS1_N <- RR_RTS1_N <- R_RTS1_N <- RTS + + P0 : bp_rs232_2line_iob + port map ( + CLK => CLK, + RXD => RXD0, + TXD => RR_TXD0, + I_RXD => I_RXD0, + O_TXD => O_TXD0 + ); + + P1 : bp_rs232_4line_iob + port map ( + CLK => CLK, + RXD => RXD1, + TXD => RR_TXD1, + CTS_N => CTS1_N, + RTS_N => RR_RTS1_N, + I_RXD => I_RXD1, + O_TXD => O_TXD1, + I_CTS_N => I_CTS1_N, + O_RTS_N => O_RTS1_N + ); + + DORELAY : if RELAY generate + proc_regs_pipe: process (CLK) + begin + if CLK'event and CLK='1' then + if RESET = '1' then + RR_RXD0 <= '1'; + RR_TXD0 <= '1'; + RR_RXD1 <= '1'; + RR_TXD1 <= '1'; + RR_CTS1_N <= '0'; + RR_RTS1_N <= '0'; + else + RR_RXD0 <= RXD0; + RR_TXD0 <= R_TXD0; + RR_RXD1 <= RXD1; + RR_TXD1 <= R_TXD1; + RR_CTS1_N <= CTS1_N; + RR_RTS1_N <= R_RTS1_N; + end if; + end if; + end process proc_regs_pipe; + end generate DORELAY; + + NORELAY : if not RELAY generate + RR_RXD0 <= RXD0; + RR_TXD0 <= R_TXD0; + RR_RXD1 <= RXD1; + RR_TXD1 <= R_TXD1; + RR_CTS1_N <= CTS1_N; + RR_RTS1_N <= R_RTS1_N; + end generate NORELAY; + + proc_regs_mux: process (CLK) + begin + + if CLK'event and CLK='1' then + if RESET = '1' then + R_RXD <= '1'; + R_CTS_N <= '0'; + R_TXD0 <= '1'; + R_TXD1 <= '1'; + R_RTS1_N <= '0'; + else + if SEL = '0' then -- use 2-line rs232, no flow cntl + R_RXD <= RR_RXD0; -- get port 0 inputs + R_CTS_N <= '0'; + R_TXD0 <= TXD; -- set port 0 output + R_TXD1 <= '1'; -- port 1 outputs to idle state + R_RTS1_N <= '0'; + else -- otherwise use 4-line rs232 + R_RXD <= RR_RXD1; -- get port 1 inputs + R_CTS_N <= RR_CTS1_N; + R_TXD0 <= '1'; -- port 0 output to idle state + R_TXD1 <= TXD; -- set port 1 outputs + R_RTS1_N <= RTS_N; + end if; + end if; + end if; + + end process proc_regs_mux; + + RXD <= R_RXD; + CTS_N <= R_CTS_N; + +end syn; diff --git a/rtl/bplib/s3board/s3_rs232_iob_ext.vbom b/rtl/bplib/bpgen/bp_rs232_2line_iob.vbom similarity index 85% rename from rtl/bplib/s3board/s3_rs232_iob_ext.vbom rename to rtl/bplib/bpgen/bp_rs232_2line_iob.vbom index 9aa5b882..8f344916 100644 --- a/rtl/bplib/s3board/s3_rs232_iob_ext.vbom +++ b/rtl/bplib/bpgen/bp_rs232_2line_iob.vbom @@ -5,4 +5,4 @@ ../../vlib/xlib/iob_reg_i.vbom ../../vlib/xlib/iob_reg_o.vbom # design -s3_rs232_iob_ext.vhd +bp_rs232_2line_iob.vhd diff --git a/rtl/bplib/s3board/s3_rs232_iob_int.vhd b/rtl/bplib/bpgen/bp_rs232_2line_iob.vhd similarity index 76% rename from rtl/bplib/s3board/s3_rs232_iob_int.vhd rename to rtl/bplib/bpgen/bp_rs232_2line_iob.vhd index 8149c645..fd45bff1 100644 --- a/rtl/bplib/s3board/s3_rs232_iob_int.vhd +++ b/rtl/bplib/bpgen/bp_rs232_2line_iob.vhd @@ -1,6 +1,6 @@ --- $Id: s3_rs232_iob_int.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: bp_rs232_2line_iob.vhd 387 2011-07-03 17:24:52Z mueller $ -- --- Copyright 2010- by Walter F.J. Mueller +-- Copyright 2010-2011 by Walter F.J. Mueller -- -- 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 @@ -12,8 +12,8 @@ -- for complete details. -- ------------------------------------------------------------------------------ --- Module Name: s3_rs232_iob_int - syn --- Description: iob's for internal rs232 +-- Module Name: bp_rs232_2line_iob - syn +-- Description: iob's for 2 line rs232 (RXD,TXD only) -- -- Dependencies: xlib/iob_reg_i -- xlib/iob_reg_o @@ -21,11 +21,12 @@ -- Test bench: - -- -- Target Devices: generic --- Tool versions: xst 11.4; ghdl 0.26 +-- Tool versions: xst 11.4, 12.1; ghdl 0.26-0.29 -- -- Revision History: -- Date Rev Version Comment --- 2010-04-17 278 1.0 Initial version +-- 2011-07-01 386 1.1 Moved and renamed to bpgen +-- 2010-04-17 278 1.0 Initial version (as s3_rs232_iob_int) ------------------------------------------------------------------------------ -- @@ -38,7 +39,7 @@ use work.xlib.all; -- ---------------------------------------------------------------------------- -entity s3_rs232_iob_int is -- iob's for internal rs232 +entity bp_rs232_2line_iob is -- iob's for 2 line rs232 (RXD,TXD) port ( CLK : in slbit; -- clock RXD : out slbit; -- receive data (board view) @@ -46,9 +47,9 @@ entity s3_rs232_iob_int is -- iob's for internal rs232 I_RXD : in slbit; -- pad-i: receive data (board view) O_TXD : out slbit -- pad-o: transmit data (board view) ); -end s3_rs232_iob_int; +end bp_rs232_2line_iob; -architecture syn of s3_rs232_iob_int is +architecture syn of bp_rs232_2line_iob is begin IOB_RXD : iob_reg_i -- line idle=1, so init sync flop =1 diff --git a/rtl/bplib/s3board/s3_rs232_iob_int.vbom b/rtl/bplib/bpgen/bp_rs232_4line_iob.vbom similarity index 85% rename from rtl/bplib/s3board/s3_rs232_iob_int.vbom rename to rtl/bplib/bpgen/bp_rs232_4line_iob.vbom index 45f225c4..588a5f71 100644 --- a/rtl/bplib/s3board/s3_rs232_iob_int.vbom +++ b/rtl/bplib/bpgen/bp_rs232_4line_iob.vbom @@ -5,4 +5,4 @@ ../../vlib/xlib/iob_reg_i.vbom ../../vlib/xlib/iob_reg_o.vbom # design -s3_rs232_iob_int.vhd +bp_rs232_4line_iob.vhd diff --git a/rtl/bplib/s3board/s3_rs232_iob_ext.vhd b/rtl/bplib/bpgen/bp_rs232_4line_iob.vhd similarity index 79% rename from rtl/bplib/s3board/s3_rs232_iob_ext.vhd rename to rtl/bplib/bpgen/bp_rs232_4line_iob.vhd index f2427457..f1a7ca34 100644 --- a/rtl/bplib/s3board/s3_rs232_iob_ext.vhd +++ b/rtl/bplib/bpgen/bp_rs232_4line_iob.vhd @@ -1,6 +1,6 @@ --- $Id: s3_rs232_iob_ext.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: bp_rs232_4line_iob.vhd 391 2011-07-09 17:25:02Z mueller $ -- --- Copyright 2010- by Walter F.J. Mueller +-- Copyright 2010-2011 by Walter F.J. Mueller -- -- 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 @@ -12,8 +12,8 @@ -- for complete details. -- ------------------------------------------------------------------------------ --- Module Name: s3_rs232_iob_ext - syn --- Description: iob's for external rs232 (PMod) +-- Module Name: bp_rs232_4line_iob - syn +-- Description: iob's for 4 line rs232 (RXD,TXD and RTS,CTS) -- -- Dependencies: xlib/iob_reg_i -- xlib/iob_reg_o @@ -21,11 +21,12 @@ -- Test bench: - -- -- Target Devices: generic --- Tool versions: xst 11.4; ghdl 0.26 +-- Tool versions: xst 11.4, 12.1; ghdl 0.26-0.29 -- -- Revision History: -- Date Rev Version Comment --- 2010-04-17 278 1.0 Initial version +-- 2011-07-01 386 1.1 moved and renamed to bpgen +-- 2010-04-17 278 1.0 Initial version (as s3_rs232_iob_ext) ------------------------------------------------------------------------------ -- @@ -38,7 +39,7 @@ use work.xlib.all; -- ---------------------------------------------------------------------------- -entity s3_rs232_iob_ext is -- iob's for external rs232 (PMod) +entity bp_rs232_4line_iob is -- iob's for 4 line rs232 (w/ RTS,CTS) port ( CLK : in slbit; -- clock RXD : out slbit; -- receive data (board view) @@ -50,9 +51,9 @@ entity s3_rs232_iob_ext is -- iob's for external rs232 (PMod) I_CTS_N : in slbit; -- pad-i: clear to send (act. low) O_RTS_N : out slbit -- pad-o: request to send (act. low) ); -end s3_rs232_iob_ext; +end bp_rs232_4line_iob; -architecture syn of s3_rs232_iob_ext is +architecture syn of bp_rs232_4line_iob is begin IOB_RXD : iob_reg_i -- line idle=1, so init sync flop =1 diff --git a/rtl/bplib/s3board/s3_humanio.vbom b/rtl/bplib/bpgen/bp_swibtnled.vbom similarity index 83% rename from rtl/bplib/s3board/s3_humanio.vbom rename to rtl/bplib/bpgen/bp_swibtnled.vbom index 7e851fe2..47820ff6 100644 --- a/rtl/bplib/s3board/s3_humanio.vbom +++ b/rtl/bplib/bpgen/bp_swibtnled.vbom @@ -2,12 +2,11 @@ ../../vlib/slvtypes.vhd ../../vlib/genlib/genlib.vhd ../../vlib/xlib/xlib.vhd -s3boardlib.vbom +bpgenlib.vbom ## sys_conf : sys_conf.vhd # components ../../vlib/xlib/iob_reg_i_gen.vbom ../../vlib/xlib/iob_reg_o_gen.vbom ../../vlib/genlib/debounce_gen.vbom -s3_dispdrv.vbom # design -s3_humanio.vhd +bp_swibtnled.vhd diff --git a/rtl/bplib/bpgen/bp_swibtnled.vhd b/rtl/bplib/bpgen/bp_swibtnled.vhd new file mode 100644 index 00000000..17bc7f40 --- /dev/null +++ b/rtl/bplib/bpgen/bp_swibtnled.vhd @@ -0,0 +1,117 @@ +-- $Id: bp_swibtnled.vhd 403 2011-08-06 17:36:22Z mueller $ +-- +-- Copyright 2011- by Walter F.J. Mueller +-- +-- 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. +-- +------------------------------------------------------------------------------ +-- Module Name: bp_swibtnled - syn +-- Description: Generic SWI, BTN and LED handling +-- +-- Dependencies: xlib/iob_reg_i_gen +-- xlib/iob_reg_o_gen +-- genlib/debounce_gen +-- +-- Test bench: - +-- +-- Target Devices: generic +-- Tool versions: xst 11.4, 12.1; ghdl 0.26-0.29 +-- +-- Revision History: +-- Date Rev Version Comment +-- 2011-07-01 386 1.0 Initial version, extracted from s3_humanio +------------------------------------------------------------------------------ +-- + +library ieee; +use ieee.std_logic_1164.all; +use ieee.std_logic_arith.all; + +use work.slvtypes.all; +use work.xlib.all; +use work.genlib.all; +use work.bpgenlib.all; + +-- ---------------------------------------------------------------------------- + +entity bp_swibtnled is -- generic SWI, BTN and LED handling + generic ( + SWIDTH : positive := 4; -- SWI port width + BWIDTH : positive := 4; -- BTN port width + LWIDTH : positive := 4; -- LED port width + DEBOUNCE : boolean := true); -- instantiate debouncer for SWI,BTN + port ( + CLK : in slbit; -- clock + RESET : in slbit := '0'; -- reset + CE_MSEC : in slbit; -- 1 ms clock enable + SWI : out slv(SWIDTH-1 downto 0); -- switch settings, debounced + BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced + LED : in slv(LWIDTH-1 downto 0); -- led data + I_SWI : in slv(SWIDTH-1 downto 0); -- pad-i: switches + I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons + O_LED : out slv(LWIDTH-1 downto 0) -- pad-o: leds + ); +end bp_swibtnled; + +architecture syn of bp_swibtnled is + + signal RI_SWI : slv(SWIDTH-1 downto 0) := (others=>'0'); + signal RI_BTN : slv(BWIDTH-1 downto 0) := (others=>'0'); + +begin + + IOB_SWI : iob_reg_i_gen + generic map (DWIDTH => SWIDTH) + port map (CLK => CLK, CE => '1', DI => RI_SWI, PAD => I_SWI); + + IOB_BTN : iob_reg_i_gen + generic map (DWIDTH => BWIDTH) + port map (CLK => CLK, CE => '1', DI => RI_BTN, PAD => I_BTN); + + IOB_LED : iob_reg_o_gen + generic map (DWIDTH => LWIDTH) + port map (CLK => CLK, CE => '1', DO => LED, PAD => O_LED); + + DEB: if DEBOUNCE generate + + DEB_SWI : debounce_gen + generic map ( + CWIDTH => 2, + CEDIV => 3, + DWIDTH => SWIDTH) + port map ( + CLK => CLK, + RESET => RESET, + CE_INT => CE_MSEC, + DI => RI_SWI, + DO => SWI + ); + + DEB_BTN : debounce_gen + generic map ( + CWIDTH => 2, + CEDIV => 3, + DWIDTH => BWIDTH) + port map ( + CLK => CLK, + RESET => RESET, + CE_INT => CE_MSEC, + DI => RI_BTN, + DO => BTN + ); + + end generate DEB; + + NODEB: if not DEBOUNCE generate + SWI <= RI_SWI; + BTN <= RI_BTN; + end generate NODEB; + +end syn; diff --git a/rtl/bplib/bpgen/bpgenlib.vbom b/rtl/bplib/bpgen/bpgenlib.vbom new file mode 100644 index 00000000..3ae84b23 --- /dev/null +++ b/rtl/bplib/bpgen/bpgenlib.vbom @@ -0,0 +1,4 @@ +# libs +../../vlib/slvtypes.vhd +../../vlib/rbus/rblib.vhd +bpgenlib.vhd diff --git a/rtl/bplib/bpgen/bpgenlib.vhd b/rtl/bplib/bpgen/bpgenlib.vhd new file mode 100644 index 00000000..d1099d28 --- /dev/null +++ b/rtl/bplib/bpgen/bpgenlib.vhd @@ -0,0 +1,180 @@ +-- $Id: bpgenlib.vhd 404 2011-08-07 22:00:25Z mueller $ +-- +-- Copyright 2011- by Walter F.J. Mueller +-- +-- 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: bpliblib +-- Description: Generic Board/Part components +-- +-- Dependencies: - +-- Tool versions: 12.1; ghdl 0.26-0.29 +-- Revision History: +-- Date Rev Version Comment +-- 2011-08-07 404 1.0.4 add RELAY generic for bp_rs232_2l4l_iob +-- 2011-08-06 403 1.0.3 add RESET port for bp_rs232_2l4l_iob +-- 2011-07-09 391 1.0.2 move in bp_rs232_2l4l_iob from s3boardlib +-- 2011-07-08 390 1.0.1 move in sn_(4x7segctl|humanio*) from s3boardlib +-- 2011-07-01 386 1.0 Initial version (with rs232_iob's and bp_swibtnled) +------------------------------------------------------------------------------ + +library ieee; +use ieee.std_logic_1164.all; +use ieee.std_logic_arith.all; + +use work.slvtypes.all; +use work.rblib.all; + +package bpgenlib is + +component bp_rs232_2line_iob is -- iob's for 2 line rs232 (RXD,TXD) + port ( + CLK : in slbit; -- clock + RXD : out slbit; -- receive data (board view) + TXD : in slbit; -- transmit data (board view) + I_RXD : in slbit; -- pad-i: receive data (board view) + O_TXD : out slbit -- pad-o: transmit data (board view) + ); +end component; + +component bp_rs232_4line_iob is -- iob's for 4 line rs232 (w/ RTS,CTS) + port ( + CLK : in slbit; -- clock + RXD : out slbit; -- receive data (board view) + TXD : in slbit; -- transmit data (board view) + CTS_N : out slbit; -- clear to send (act. low) + RTS_N : in slbit; -- request to send (act. low) + I_RXD : in slbit; -- pad-i: receive data (board view) + O_TXD : out slbit; -- pad-o: transmit data (board view) + I_CTS_N : in slbit; -- pad-i: clear to send (act. low) + O_RTS_N : out slbit -- pad-o: request to send (act. low) + ); +end component; + +component bp_rs232_2l4l_iob is -- iob's for dual 2l+4l rs232, w/ select + generic ( + RELAY : boolean := false); -- add a relay stage towards IOB's + port ( + CLK : in slbit; -- clock + RESET : in slbit := '0'; -- reset + SEL : in slbit; -- select, '0' for port 0 + RXD : out slbit; -- receive data (board view) + TXD : in slbit; -- transmit data (board view) + CTS_N : out slbit; -- clear to send (act. low) + RTS_N : in slbit; -- request to send (act. low) + I_RXD0 : in slbit; -- pad-i: p0: receive data (board view) + O_TXD0 : out slbit; -- pad-o: p0: transmit data (board view) + I_RXD1 : in slbit; -- pad-i: p1: receive data (board view) + O_TXD1 : out slbit; -- pad-o: p1: transmit data (board view) + I_CTS1_N : in slbit; -- pad-i: p1: clear to send (act. low) + O_RTS1_N : out slbit -- pad-o: p1: request to send (act. low) + ); +end component; + +component bp_swibtnled is -- generic SWI, BTN and LED handling + generic ( + SWIDTH : positive := 4; -- SWI port width + BWIDTH : positive := 4; -- BTN port width + LWIDTH : positive := 4; -- LED port width + DEBOUNCE : boolean := true); -- instantiate debouncer for SWI,BTN + port ( + CLK : in slbit; -- clock + RESET : in slbit := '0'; -- reset + CE_MSEC : in slbit; -- 1 ms clock enable + SWI : out slv(SWIDTH-1 downto 0); -- switch settings, debounced + BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced + LED : in slv(LWIDTH-1 downto 0); -- led data + I_SWI : in slv(SWIDTH-1 downto 0); -- pad-i: switches + I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons + O_LED : out slv(LWIDTH-1 downto 0) -- pad-o: leds + ); +end component; + +component bp_swibtnled_rbus is -- swi,btn,led handling /w rbus icept + generic ( + SWIDTH : positive := 4; -- SWI port width + BWIDTH : positive := 4; -- BTN port width + LWIDTH : positive := 4; -- LED port width + DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN + RB_ADDR : slv8 := conv_std_logic_vector(2#10000000#,8)); + port ( + CLK : in slbit; -- clock + RESET : in slbit := '0'; -- reset + CE_MSEC : in slbit; -- 1 ms clock enable + RB_MREQ : in rb_mreq_type; -- rbus: request + RB_SRES : out rb_sres_type; -- rbus: response + SWI : out slv(SWIDTH-1 downto 0); -- switch settings, debounced + BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced + LED : in slv(LWIDTH-1 downto 0); -- led data + I_SWI : in slv(SWIDTH-1 downto 0); -- pad-i: switches + I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons + O_LED : out slv(LWIDTH-1 downto 0) -- pad-o: leds + ); +end component; + +component sn_4x7segctl is -- Quad 7 segment display controller + generic ( + CDWIDTH : positive := 6); -- clk divider width (must be >= 5) + port ( + CLK : in slbit; -- clock + DIN : in slv16; -- data + DP : in slv4; -- decimal points + ANO_N : out slv4; -- anodes (act.low) + SEG_N : out slv8 -- segements (act.low) + ); +end component; + +component sn_humanio is -- human i/o handling: swi,btn,led,dsp + generic ( + BWIDTH : positive := 4; -- BTN port width + DEBOUNCE : boolean := true); -- instantiate debouncer for SWI,BTN + port ( + CLK : in slbit; -- clock + RESET : in slbit := '0'; -- reset + CE_MSEC : in slbit; -- 1 ms clock enable + SWI : out slv8; -- switch settings, debounced + BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced + LED : in slv8; -- led data + DSP_DAT : in slv16; -- display data + DSP_DP : in slv4; -- display decimal points + I_SWI : in slv8; -- pad-i: switches + I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons + O_LED : out slv8; -- pad-o: leds + O_ANO_N : out slv4; -- pad-o: 7 seg disp: anodes (act.low) + O_SEG_N : out slv8 -- pad-o: 7 seg disp: segments (act.low) + ); +end component; + +component sn_humanio_rbus is -- human i/o handling /w rbus intercept + generic ( + BWIDTH : positive := 4; -- BTN port width + DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN + RB_ADDR : slv8 := conv_std_logic_vector(2#10000000#,8)); + port ( + CLK : in slbit; -- clock + RESET : in slbit := '0'; -- reset + CE_MSEC : in slbit; -- 1 ms clock enable + RB_MREQ : in rb_mreq_type; -- rbus: request + RB_SRES : out rb_sres_type; -- rbus: response + SWI : out slv8; -- switch settings, debounced + BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced + LED : in slv8; -- led data + DSP_DAT : in slv16; -- display data + DSP_DP : in slv4; -- display decimal points + I_SWI : in slv8; -- pad-i: switches + I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons + O_LED : out slv8; -- pad-o: leds + O_ANO_N : out slv4; -- pad-o: 7 seg disp: anodes (act.low) + O_SEG_N : out slv8 -- pad-o: 7 seg disp: segments (act.low) + ); +end component; + +end package bpgenlib; diff --git a/rtl/bplib/s3board/s3_dispdrv.vbom b/rtl/bplib/bpgen/sn_4x7segctl.vbom similarity index 75% rename from rtl/bplib/s3board/s3_dispdrv.vbom rename to rtl/bplib/bpgen/sn_4x7segctl.vbom index 179d4b58..af92f9dc 100644 --- a/rtl/bplib/s3board/s3_dispdrv.vbom +++ b/rtl/bplib/bpgen/sn_4x7segctl.vbom @@ -2,4 +2,4 @@ ../../vlib/slvtypes.vhd # components # design -s3_dispdrv.vhd +sn_4x7segctl.vhd diff --git a/rtl/bplib/s3board/s3_dispdrv.vhd b/rtl/bplib/bpgen/sn_4x7segctl.vhd similarity index 78% rename from rtl/bplib/s3board/s3_dispdrv.vhd rename to rtl/bplib/bpgen/sn_4x7segctl.vhd index 0d8fa4c4..d085af59 100644 --- a/rtl/bplib/s3board/s3_dispdrv.vhd +++ b/rtl/bplib/bpgen/sn_4x7segctl.vhd @@ -1,6 +1,6 @@ --- $Id: s3_dispdrv.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: sn_4x7segctl.vhd 400 2011-07-31 09:02:16Z mueller $ -- --- Copyright 2007-2010 by Walter F.J. Mueller +-- Copyright 2007-2011 by Walter F.J. Mueller -- -- 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 @@ -12,15 +12,17 @@ -- for complete details. -- ------------------------------------------------------------------------------ --- Module Name: s3_dispdrv - syn --- Description: s3board: 7 segment display driver +-- Module Name: sn_4x7segctl - syn +-- Description: Quad 7 segment display controller (for s3board and nexys2/3) -- -- Dependencies: - -- Test bench: - -- Target Devices: generic --- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4; ghdl 0.18-0.26 +-- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4, 12.1; ghdl 0.18-0.29 -- Revision History: -- Date Rev Version Comment +-- 2011-07-30 400 1.2 digit dark in last quarter (not 16 clocks) +-- 2011-07-08 390 1.1.2 renamed from s3_dispdrv -- 2010-04-17 278 1.1.1 renamed from dispdrv -- 2010-03-29 272 1.1 add all ANO off time to allow to driver turn-off -- delay and to avoid cross talk between digits @@ -34,7 +36,7 @@ use ieee.std_logic_arith.all; use work.slvtypes.all; -entity s3_dispdrv is -- 7 segment display driver +entity sn_4x7segctl is -- Quad 7 segment display controller generic ( CDWIDTH : positive := 6); -- clk divider width (must be >= 5) port ( @@ -44,9 +46,9 @@ entity s3_dispdrv is -- 7 segment display driver ANO_N : out slv4; -- anodes (act.low) SEG_N : out slv8 -- segements (act.low) ); -end s3_dispdrv; +end sn_4x7segctl; -architecture syn of s3_dispdrv is +architecture syn of sn_4x7segctl is type regs_type is record cdiv : std_logic_vector(CDWIDTH-1 downto 0); -- clock divider counter @@ -128,16 +130,18 @@ begin end case; -- the logic below ensures that the anode PNP driver transistor is switched - -- off 16 cycles before the cathode drivers change. This prevents 'cross - -- talk' between digits due to transistor turn off delays. With no or 4 - -- cycles gap one gets well visible cross talk, with 8 cycles still some - -- weak cross talk. With 16 cycles (at 50MHz) none is visible. The - -- turn-off delay of the anode driver PNP's this therefore larger 160 ns - -- and below 320 ns. - -- As consquence CDWIDTH should be at least 5, better 6. + -- off in the last quarter of the digit cycle.This prevents 'cross talk' + -- between digits due to transistor turn off delays. + -- For a nexys2 board at 50 MHz observed: + -- no or 4 cycles gap well visible cross talk + -- with 8 cycles still some weak cross talk + -- with 16 cycles none is visible. + -- --> The turn-off delay of the anode driver PNP's this therefore + -- larger 160 ns and below 320 ns. + -- As consquence CDWIDTH should be at least 6 for 50 MHz and 7 for 100 MHz. cano := "1111"; - if unsigned(r.cdiv) >= 16 then + if r.cdiv(CDWIDTH-1 downto CDWIDTH-2) /= "00" then cano(conv_integer(unsigned(r.dcnt))) := '0'; end if; diff --git a/rtl/bplib/bpgen/sn_humanio.vbom b/rtl/bplib/bpgen/sn_humanio.vbom new file mode 100644 index 00000000..4ff2ba88 --- /dev/null +++ b/rtl/bplib/bpgen/sn_humanio.vbom @@ -0,0 +1,11 @@ +# libs +../../vlib/slvtypes.vhd +../../vlib/xlib/xlib.vhd +bpgenlib.vbom +## sys_conf : sys_conf.vhd +# components +../../vlib/xlib/iob_reg_o_gen.vbom +bp_swibtnled.vbom +sn_4x7segctl.vbom +# design +sn_humanio.vhd diff --git a/rtl/bplib/s3board/s3_humanio.vhd b/rtl/bplib/bpgen/sn_humanio.vhd similarity index 58% rename from rtl/bplib/s3board/s3_humanio.vhd rename to rtl/bplib/bpgen/sn_humanio.vhd index 5165a65b..ce163f18 100644 --- a/rtl/bplib/s3board/s3_humanio.vhd +++ b/rtl/bplib/bpgen/sn_humanio.vhd @@ -1,6 +1,6 @@ --- $Id: s3_humanio.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: sn_humanio.vhd 403 2011-08-06 17:36:22Z mueller $ -- --- Copyright 2010- by Walter F.J. Mueller +-- Copyright 2010-2011 by Walter F.J. Mueller -- -- 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 @@ -12,13 +12,12 @@ -- for complete details. -- ------------------------------------------------------------------------------ --- Module Name: s3_humanio - syn --- Description: All BTN, SWI, LED and DSP handling for s3board +-- Module Name: sn_humanio - syn +-- Description: All BTN, SWI, LED and DSP handling for s3board, nexys2/3 -- --- Dependencies: xlib/iob_reg_i_gen --- xlib/iob_reg_o_gen --- genlib/debounce_gen --- s3board/s3_dispdrv +-- Dependencies: xlib/iob_reg_o_gen +-- bpgen/bp_swibtnled +-- bpgen/sn_4x7segctl -- -- Test bench: - -- @@ -27,10 +26,14 @@ -- -- Synthesized (xst): -- Date Rev ise Target flop lutl lutm slic t peri --- 2010-04-10 275 11.4 L68 xc3s1000-4 80 87 0 53 s 5.2 ns +-- 2011-07-02 387 12.1 M53d xc3s1000-4 48 87 0 53 s 5.1 ns +-- 2010-04-10 275 11.4 L68 xc3s1000-4 48 87 0 53 s 5.2 ns -- -- Revision History: -- Date Rev Version Comment +-- 2011-07-30 400 1.2.1 use CDWIDTH=7 for sn_4x7segctl (for 100 MHz) +-- 2011-07-08 390 1.2 renamed from s3_humanio, add BWIDTH generic +-- 2011-07-02 387 1.1.2 use bp_swibtnled -- 2010-04-17 278 1.1.1 rename dispdrv -> s3_dispdrv -- 2010-04-11 276 1.1 instantiate BTN/SWI debouncers via DEBOUNCE generic -- 2010-04-10 275 1.0 Initial version @@ -43,53 +46,38 @@ use ieee.std_logic_arith.all; use work.slvtypes.all; use work.xlib.all; -use work.genlib.all; -use work.s3boardlib.all; +use work.bpgenlib.all; -- ---------------------------------------------------------------------------- -entity s3_humanio is -- human i/o handling: swi,btn,led,dsp +entity sn_humanio is -- human i/o handling: swi,btn,led,dsp generic ( + BWIDTH : positive := 4; -- BTN port width DEBOUNCE : boolean := true); -- instantiate debouncer for SWI,BTN port ( CLK : in slbit; -- clock - RESET : in slbit; -- reset + RESET : in slbit := '0'; -- reset CE_MSEC : in slbit; -- 1 ms clock enable SWI : out slv8; -- switch settings, debounced - BTN : out slv4; -- button settings, debounced + BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced LED : in slv8; -- led data DSP_DAT : in slv16; -- display data DSP_DP : in slv4; -- display decimal points I_SWI : in slv8; -- pad-i: switches - I_BTN : in slv4; -- pad-i: buttons + I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons O_LED : out slv8; -- pad-o: leds O_ANO_N : out slv4; -- pad-o: 7 seg disp: anodes (act.low) O_SEG_N : out slv8 -- pad-o: 7 seg disp: segments (act.low) ); -end s3_humanio; +end sn_humanio; -architecture syn of s3_humanio is +architecture syn of sn_humanio is - signal RI_SWI : slv8 := (others=>'0'); - signal RI_BTN : slv4 := (others=>'0'); - signal N_ANO_N : slv4 := (others=>'0'); signal N_SEG_N : slv8 := (others=>'0'); begin - IOB_SWI : iob_reg_i_gen - generic map (DWIDTH => 8) - port map (CLK => CLK, CE => '1', DI => RI_SWI, PAD => I_SWI); - - IOB_BTN : iob_reg_i_gen - generic map (DWIDTH => 4) - port map (CLK => CLK, CE => '1', DI => RI_BTN, PAD => I_BTN); - - IOB_LED : iob_reg_o_gen - generic map (DWIDTH => 8) - port map (CLK => CLK, CE => '1', DO => LED, PAD => O_LED); - IOB_ANO_N : iob_reg_o_gen generic map (DWIDTH => 4) port map (CLK => CLK, CE => '1', DO => N_ANO_N, PAD => O_ANO_N); @@ -98,44 +86,27 @@ begin generic map (DWIDTH => 8) port map (CLK => CLK, CE => '1', DO => N_SEG_N, PAD => O_SEG_N); - DEB: if DEBOUNCE generate - - DEB_SWI : debounce_gen - generic map ( - CWIDTH => 2, - CEDIV => 3, - DWIDTH => 8) - port map ( - CLK => CLK, - RESET => RESET, - CE_INT => CE_MSEC, - DI => RI_SWI, - DO => SWI - ); - - DEB_BTN : debounce_gen - generic map ( - CWIDTH => 2, - CEDIV => 3, - DWIDTH => 4) - port map ( - CLK => CLK, - RESET => RESET, - CE_INT => CE_MSEC, - DI => RI_BTN, - DO => BTN - ); - - end generate DEB; - - NODEB: if not DEBOUNCE generate - SWI <= RI_SWI; - BTN <= RI_BTN; - end generate NODEB; - - DRV : s3_dispdrv + HIO : bp_swibtnled generic map ( - CDWIDTH => 6) + SWIDTH => 8, + BWIDTH => BWIDTH, + LWIDTH => 8, + DEBOUNCE => DEBOUNCE) + port map ( + CLK => CLK, + RESET => RESET, + CE_MSEC => CE_MSEC, + SWI => SWI, + BTN => BTN, + LED => LED, + I_SWI => I_SWI, + I_BTN => I_BTN, + O_LED => O_LED + ); + + DRV : sn_4x7segctl + generic map ( + CDWIDTH => 7) -- 7 good for 100 MHz on nexys2 port map ( CLK => CLK, DIN => DSP_DAT, diff --git a/rtl/bplib/s3board/s3_humanio_rbus.vbom b/rtl/bplib/bpgen/sn_humanio_rbus.vbom similarity index 60% rename from rtl/bplib/s3board/s3_humanio_rbus.vbom rename to rtl/bplib/bpgen/sn_humanio_rbus.vbom index 5cf3d7f7..814cc400 100644 --- a/rtl/bplib/s3board/s3_humanio_rbus.vbom +++ b/rtl/bplib/bpgen/sn_humanio_rbus.vbom @@ -1,8 +1,8 @@ # libs ../../vlib/slvtypes.vhd ../../vlib/rbus/rblib.vhd -s3boardlib.vbom +bpgenlib.vbom # components -s3_humanio.vbom +sn_humanio.vbom # design -s3_humanio_rbus.vhd +sn_humanio_rbus.vhd diff --git a/rtl/bplib/s3board/s3_humanio_rbus.vhd b/rtl/bplib/bpgen/sn_humanio_rbus.vhd similarity index 60% rename from rtl/bplib/s3board/s3_humanio_rbus.vhd rename to rtl/bplib/bpgen/sn_humanio_rbus.vhd index af060861..a371789f 100644 --- a/rtl/bplib/s3board/s3_humanio_rbus.vhd +++ b/rtl/bplib/bpgen/sn_humanio_rbus.vhd @@ -1,6 +1,6 @@ --- $Id: s3_humanio_rbus.vhd 352 2011-01-02 13:01:37Z mueller $ +-- $Id: sn_humanio_rbus.vhd 406 2011-08-14 21:06:44Z mueller $ -- --- Copyright 2010- by Walter F.J. Mueller +-- Copyright 2010-2011 by Walter F.J. Mueller -- -- 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 @@ -12,10 +12,10 @@ -- for complete details. -- ------------------------------------------------------------------------------ --- Module Name: s3_humanio_rbus - syn --- Description: s3_humanio with rbus interceptor +-- Module Name: sn_humanio_rbus - syn +-- Description: sn_humanio with rbus interceptor -- --- Dependencies: s3board/s3_humanio +-- Dependencies: bpgen/sn_humanio -- -- Test bench: - -- @@ -24,11 +24,16 @@ -- -- Synthesized (xst): -- Date Rev ise Target flop lutl lutm slic t peri --- 2010-12-29 300 12.1 M53d xc3s1000-4 93 138 0 111 s 6.8 ns +-- 2011-08-14 406 12.1 M53d xc3s1000-4 142 156 0 123 s 5.1 ns +-- 2011-08-07 404 12.1 M53d xc3s1000-4 142 157 0 124 s 5.1 ns +-- 2010-12-29 351 12.1 M53d xc3s1000-4 93 138 0 111 s 6.8 ns -- 2010-06-03 300 11.4 L68 xc3s1000-4 92 137 0 111 s 6.7 ns -- -- Revision History: -- Date Rev Version Comment +-- 2011-08-14 406 1.2 common register layout with bp_swibtnled_rbus +-- 2011-08-07 404 1.3 add pipeline regs ledin,(swi,btn,led,dp,dat)eff +-- 2011-07-08 390 1.2 renamed from s3_humanio_rbus, add BWIDTH generic -- 2010-12-29 351 1.1 renamed from s3_humanio_rri; ported to rbv3 -- 2010-06-18 306 1.0.1 rename rbus data fields to _rbf_ -- 2010-06-03 300 1.0 Initial version @@ -38,24 +43,24 @@ -- -- Address Bits Name r/w/f Function -- bbbbbb00 cntl r/w/- Control register and BTN access --- 11 dat_en r/w/- if 1 display data will be driven by rri --- 10 dp_en r/w/- if 1 display dp's will be driven by rri --- 9 led_en r/w/- if 1 LED will be driven by rri --- 8 swi_en r/w/- if 1 SWI will be driven by rri --- 3:00 btn r/w/- r: return hio BTN status --- w: BTN is hio BTN ored with this fields +-- x:08 btn r/w/- r: return hio BTN status +-- w: ored with hio BTN to drive BTN +-- 3 dsp_en r/w/- if 1 display data will be driven by rbus +-- 2 dp_en r/w/- if 1 display dp's will be driven by rbus +-- 1 led_en r/w/- if 1 LED will be driven by rri +-- 0 swi_en r/w/- if 1 SWI will be driven by rri -- -- bbbbbb01 7:00 swi r/w/- r: return hio SWI status -- w: will drive SWI when swi_en=1 -- --- bbbbbb10 leddp r/w/- Interface to LED and DSP_DP --- 11:09 dsp_dp r/w/- r: returns DSP_DP status +-- bbbbbb10 led r/w/- Interface to LED and DSP_DP +-- 15:12 dp r/w/- r: returns DSP_DP status -- w: will drive display dp's when dp_en=1 -- 7:00 led r/w/- r: returns LED status -- w: will drive led's when led_en=1 -- --- bbbbbb11 15:00 dsp_dat r/w/- r: return hio DSP_DAT status --- w: will drive DSP_DAT when dat_en=1 +-- bbbbbb11 15:00 dsp r/w/- r: return hio DSP_DAT status +-- w: will drive DSP_DAT when dsp_en=1 -- library ieee; @@ -64,84 +69,100 @@ use ieee.std_logic_arith.all; use work.slvtypes.all; use work.rblib.all; -use work.s3boardlib.all; +use work.bpgenlib.all; -- ---------------------------------------------------------------------------- -entity s3_humanio_rbus is -- human i/o handling /w rbus intercept +entity sn_humanio_rbus is -- human i/o handling /w rbus intercept generic ( + BWIDTH : positive := 4; -- BTN port width DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN RB_ADDR : slv8 := conv_std_logic_vector(2#10000000#,8)); port ( CLK : in slbit; -- clock - RESET : in slbit; -- reset + RESET : in slbit := '0'; -- reset CE_MSEC : in slbit; -- 1 ms clock enable RB_MREQ : in rb_mreq_type; -- rbus: request RB_SRES : out rb_sres_type; -- rbus: response SWI : out slv8; -- switch settings, debounced - BTN : out slv4; -- button settings, debounced + BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced LED : in slv8; -- led data DSP_DAT : in slv16; -- display data DSP_DP : in slv4; -- display decimal points I_SWI : in slv8; -- pad-i: switches - I_BTN : in slv4; -- pad-i: buttons + I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons O_LED : out slv8; -- pad-o: leds O_ANO_N : out slv4; -- pad-o: 7 seg disp: anodes (act.low) O_SEG_N : out slv8 -- pad-o: 7 seg disp: segments (act.low) ); -end s3_humanio_rbus; +end sn_humanio_rbus; -architecture syn of s3_humanio_rbus is +architecture syn of sn_humanio_rbus is type regs_type is record rbsel : slbit; -- rbus select swi : slv8; -- rbus swi - btn : slv4; -- rbus btn + btn : slv(BWIDTH-1 downto 0); -- rbus btn led : slv8; -- rbus led dsp_dat : slv16; -- rbus dsp_dat dsp_dp : slv4; -- rbus dsp_dp - swi_en : slbit; -- enable: swi from rri - led_en : slbit; -- enable: led from rri - dat_en : slbit; -- enable: dsp_dat from rri - dp_en : slbit; -- enable: dsp_dp from rri + ledin : slv8; -- led from design + swieff : slv8; -- effective swi + btneff : slv(BWIDTH-1 downto 0); -- effective btn + ledeff : slv8; -- effective led + dpeff : slv4; -- effective dsp_dp + dateff : slv16; -- effective dsp_dat + swi_en : slbit; -- enable: swi from rbus + led_en : slbit; -- enable: led from rbus + dsp_en : slbit; -- enable: dsp_dat from rbus + dp_en : slbit; -- enable: dsp_dp from rbus end record regs_type; + + constant btnzero : slv(BWIDTH-1 downto 0) := (others=>'0'); constant regs_init : regs_type := ( '0', -- rbsel (others=>'0'), -- swi - (others=>'0'), -- btn + btnzero, -- btn (others=>'0'), -- led (others=>'0'), -- dsp_dat (others=>'0'), -- dsp_dp - '0','0','0','0' -- (swi|led|dat|dp)_en + (others=>'0'), -- ledin + (others=>'0'), -- swieff + btnzero, -- btneff + (others=>'0'), -- ledeff + (others=>'0'), -- dpeff + (others=>'0'), -- dateff + '0','0','0','0' -- (swi|led|dsp|dp)_en ); signal R_REGS : regs_type := regs_init; -- state registers signal N_REGS : regs_type := regs_init; -- next value state regs - constant cntl_rbf_dat_en: integer := 11; - constant cntl_rbf_dp_en: integer := 10; - constant cntl_rbf_led_en: integer := 9; - constant cntl_rbf_swi_en: integer := 8; - subtype cntl_rbf_btn is integer range 3 downto 0; - subtype leddp_rbf_dsp_dp is integer range 11 downto 8; - subtype leddp_rbf_led is integer range 7 downto 0; + subtype cntl_rbf_btn is integer range BWIDTH+8-1 downto 8; + constant cntl_rbf_dsp_en: integer := 3; + constant cntl_rbf_dp_en: integer := 2; + constant cntl_rbf_led_en: integer := 1; + constant cntl_rbf_swi_en: integer := 0; + subtype led_rbf_dp is integer range 15 downto 12; + subtype led_rbf_led is integer range 7 downto 0; - constant rbaddr_cntl: slv2 := "00"; -- 0 -/r/w - constant rbaddr_swi: slv2 := "01"; -- 1 -/r/w - constant rbaddr_leddp: slv2 := "10"; -- 2 -/r/w - constant rbaddr_dsp: slv2 := "11"; -- 3 -/r/w + constant rbaddr_cntl: slv2 := "00"; -- 0 r/w/- + constant rbaddr_swi: slv2 := "01"; -- 1 r/w/- + constant rbaddr_led: slv2 := "10"; -- 2 r/w/- + constant rbaddr_dsp: slv2 := "11"; -- 3 r/w/- signal HIO_SWI : slv8 := (others=>'0'); - signal HIO_BTN : slv4 := (others=>'0'); + signal HIO_BTN : slv(BWIDTH-1 downto 0) := (others=>'0'); signal HIO_LED : slv8 := (others=>'0'); signal HIO_DSP_DAT : slv16 := (others=>'0'); signal HIO_DSP_DP : slv4 := (others=>'0'); begin - HIO : s3_humanio + HIO : sn_humanio generic map ( + BWIDTH => BWIDTH, DEBOUNCE => DEBOUNCE) port map ( CLK => CLK, @@ -173,7 +194,7 @@ begin end process proc_regs; proc_next: process (R_REGS, RB_MREQ, LED, DSP_DAT, DSP_DP, - HIO_SWI, HIO_BTN, HIO_LED, HIO_DSP_DAT, HIO_DSP_DP) + HIO_SWI, HIO_BTN, HIO_DSP_DAT, HIO_DSP_DP) variable r : regs_type := regs_init; variable n : regs_type := regs_init; @@ -196,6 +217,9 @@ begin irbena := RB_MREQ.re or RB_MREQ.we; + -- input register for LED signal + n.ledin := LED; + -- rbus address decoder n.rbsel := '0'; if RB_MREQ.aval='1' and RB_MREQ.addr(7 downto 2)=RB_ADDR(7 downto 2) then @@ -209,17 +233,17 @@ begin case RB_MREQ.addr(1 downto 0) is when rbaddr_cntl => - irb_dout(cntl_rbf_dat_en) := r.dat_en; + irb_dout(cntl_rbf_btn) := HIO_BTN; + irb_dout(cntl_rbf_dsp_en) := r.dsp_en; irb_dout(cntl_rbf_dp_en) := r.dp_en; irb_dout(cntl_rbf_led_en) := r.led_en; irb_dout(cntl_rbf_swi_en) := r.swi_en; - irb_dout(cntl_rbf_btn) := HIO_BTN; if RB_MREQ.we = '1' then - n.dat_en := RB_MREQ.din(cntl_rbf_dat_en); + n.btn := RB_MREQ.din(cntl_rbf_btn); + n.dsp_en := RB_MREQ.din(cntl_rbf_dsp_en); n.dp_en := RB_MREQ.din(cntl_rbf_dp_en); n.led_en := RB_MREQ.din(cntl_rbf_led_en); n.swi_en := RB_MREQ.din(cntl_rbf_swi_en); - n.btn := RB_MREQ.din(cntl_rbf_btn); end if; when rbaddr_swi => @@ -228,12 +252,12 @@ begin n.swi := RB_MREQ.din(n.swi'range); end if; - when rbaddr_leddp => - irb_dout(leddp_rbf_dsp_dp) := HIO_DSP_DP; - irb_dout(leddp_rbf_led) := HIO_LED; + when rbaddr_led => + irb_dout(led_rbf_dp) := HIO_DSP_DP; + irb_dout(led_rbf_led) := r.ledin; if RB_MREQ.we = '1' then - n.dsp_dp := RB_MREQ.din(leddp_rbf_dsp_dp); - n.led := RB_MREQ.din(leddp_rbf_led); + n.dsp_dp := RB_MREQ.din(led_rbf_dp); + n.led := RB_MREQ.din(led_rbf_led); end if; when rbaddr_dsp => @@ -247,34 +271,40 @@ begin end if; - BTN <= HIO_BTN or r.btn; + n.btneff := HIO_BTN or r.btn; if r.swi_en = '0' then - SWI <= HIO_SWI; + n.swieff := HIO_SWI; else - SWI <= r.swi; + n.swieff := r.swi; end if; if r.led_en = '0' then - HIO_LED <= LED; + n.ledeff := r.ledin; else - HIO_LED <= r.led; + n.ledeff := r.led; end if; if r.dp_en = '0' then - HIO_DSP_DP <= DSP_DP; + n.dpeff := DSP_DP; else - HIO_DSP_DP <= r.dsp_dp; + n.dpeff := r.dsp_dp; end if; - if r.dat_en = '0' then - HIO_DSP_DAT <= DSP_DAT; + if r.dsp_en = '0' then + n.dateff := DSP_DAT; else - HIO_DSP_DAT <= r.dsp_dat; + n.dateff := r.dsp_dat; end if; N_REGS <= n; + BTN <= R_REGS.btneff; + SWI <= R_REGS.swieff; + HIO_LED <= R_REGS.ledeff; + HIO_DSP_DP <= R_REGS.dpeff; + HIO_DSP_DAT <= R_REGS.dateff; + RB_SRES <= rb_sres_init; RB_SRES.ack <= irb_ack; RB_SRES.busy <= irb_busy; diff --git a/rtl/bplib/issi/Makefile b/rtl/bplib/issi/Makefile index a2ab5e30..246f76dc 100644 --- a/rtl/bplib/issi/Makefile +++ b/rtl/bplib/issi/Makefile @@ -1,17 +1,18 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-14 101 1.0 Initial version # # -.phony : clean +.PHONY : clean # clean : ghdl_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl +include $(RETROBASE)/rtl/make/generic_ghdl.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/bplib/nexys2/Makefile b/rtl/bplib/nexys2/Makefile index b28f3edd..1694cfd9 100644 --- a/rtl/bplib/nexys2/Makefile +++ b/rtl/bplib/nexys2/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2010-05-23 293 1.0 Initial version (cloned..) # VBOM_all = $(wildcard *.vbom) @@ -9,7 +10,7 @@ NGC_all = $(VBOM_all:.vbom=.ngc) # ISE_PATH = xc3s1200e-fg320-4 # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -17,7 +18,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/bplib/nexys2/nexys2_pins.ucf b/rtl/bplib/nexys2/nexys2_pins.ucf index 30b32e85..5a6163f9 100644 --- a/rtl/bplib/nexys2/nexys2_pins.ucf +++ b/rtl/bplib/nexys2/nexys2_pins.ucf @@ -1,9 +1,9 @@ -## $Id: nexys2_pins.ucf 338 2010-11-13 22:19:25Z mueller $ +## $Id: nexys2_pins.ucf 402 2011-08-05 18:56:44Z mueller $ ## ## Pin locks for Nexys 2 core functionality (for 1200k FPGA) -## internal RS232 -## human I/O (switches, buttons, leds, display) -## cram +## - internal RS232 +## - human I/O (switches, buttons, leds, display) +## - cram ## ## Revision History: ## Date Rev Version Comment diff --git a/rtl/bplib/nexys2/nexys2lib.vhd b/rtl/bplib/nexys2/nexys2lib.vhd index 73afdbe0..a4aa99bd 100644 --- a/rtl/bplib/nexys2/nexys2lib.vhd +++ b/rtl/bplib/nexys2/nexys2lib.vhd @@ -1,4 +1,4 @@ --- $Id: nexys2lib.vhd 338 2010-11-13 22:19:25Z mueller $ +-- $Id: nexys2lib.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2010- by Walter F.J. Mueller -- @@ -54,7 +54,7 @@ component nexys2_aif is -- NEXYS 2, abstract iface, base O_MEM_CLK : out slbit; -- cram: clock O_MEM_CRE : out slbit; -- cram: command register enable I_MEM_WAIT : in slbit; -- cram: mem wait - O_FLA_CE_N : out slbit; -- flash ce.. (act.low) + O_FLA_CE_N : out slbit; -- flash ce.. (act.low) O_MEM_ADDR : out slv23; -- cram: address lines IO_MEM_DATA : inout slv16 -- cram: data lines ); @@ -138,4 +138,4 @@ component n2_cram_memctl_as is -- CRAM driver (async+page mode) ); end component; -end nexys2lib; +end package nexys2lib; diff --git a/rtl/bplib/nexys2/tb/Makefile b/rtl/bplib/nexys2/tb/Makefile index 272d43bd..19018e77 100644 --- a/rtl/bplib/nexys2/tb/Makefile +++ b/rtl/bplib/nexys2/tb/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2010-05-30 297 1.0.2 use tb_n2_cram_memctl_as now # 2010-05-28 295 1.0.1 add tb_.._dummy's # 2007-09-23 84 1.0 Initial version @@ -10,7 +11,7 @@ EXE_all = tb_nexys2_dummy tb_nexys2_fusp_dummy tb_n2_cram_memctl_as # ISE_PATH = xc3s1200e-fg320-4 # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -20,9 +21,9 @@ clean : ise_clean ghdl_clean isim_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.isim -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_isim.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/bplib/s3board/Makefile b/rtl/bplib/s3board/Makefile index a9d8c172..14685b7a 100644 --- a/rtl/bplib/s3board/Makefile +++ b/rtl/bplib/s3board/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-09 100 1.0.1 drop ISE_p definition # 2007-09-16 83 1.0 Initial version # @@ -10,7 +11,7 @@ NGC_all = $(VBOM_all:.vbom=.ngc) # ISE_PATH = xc3s1000-ft256-4 # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -18,7 +19,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/bplib/s3board/s3_rs232_iob_int_ext.vbom b/rtl/bplib/s3board/s3_rs232_iob_int_ext.vbom deleted file mode 100644 index 6f32190c..00000000 --- a/rtl/bplib/s3board/s3_rs232_iob_int_ext.vbom +++ /dev/null @@ -1,8 +0,0 @@ -# libs -../../vlib/slvtypes.vhd -s3boardlib.vbom -# components -s3_rs232_iob_int.vbom -s3_rs232_iob_ext.vbom -# design -s3_rs232_iob_int_ext.vhd diff --git a/rtl/bplib/s3board/s3_rs232_iob_int_ext.vhd b/rtl/bplib/s3board/s3_rs232_iob_int_ext.vhd deleted file mode 100644 index bee6cf07..00000000 --- a/rtl/bplib/s3board/s3_rs232_iob_int_ext.vhd +++ /dev/null @@ -1,106 +0,0 @@ --- $Id: s3_rs232_iob_int_ext.vhd 314 2010-07-09 17:38:41Z mueller $ --- --- Copyright 2010- by Walter F.J. Mueller --- --- 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. --- ------------------------------------------------------------------------------- --- Module Name: s3_rs232_iob_int_ext - syn --- Description: iob's for internal + external rs232, with select --- --- Dependencies: s3_rs232_iob_int --- s3_rs232_iob_ext --- --- Test bench: - --- --- Target Devices: generic --- Tool versions: xst 11.4; ghdl 0.26 --- --- Revision History: --- Date Rev Version Comment --- 2010-04-17 278 1.0 Initial version ------------------------------------------------------------------------------- --- - -library ieee; -use ieee.std_logic_1164.all; -use ieee.std_logic_arith.all; - -use work.slvtypes.all; -use work.s3boardlib.all; - --- ---------------------------------------------------------------------------- - -entity s3_rs232_iob_int_ext is -- iob's for int+ext rs232, with select - port ( - CLK : in slbit; -- clock - SEL : in slbit; -- select, '0' for port 0 - RXD : out slbit; -- receive data (board view) - TXD : in slbit; -- transmit data (board view) - CTS_N : out slbit; -- clear to send (act. low) - RTS_N : in slbit; -- request to send (act. low) - I_RXD0 : in slbit; -- pad-i: p0: receive data (board view) - O_TXD0 : out slbit; -- pad-o: p0: transmit data (board view) - I_RXD1 : in slbit; -- pad-i: p1: receive data (board view) - O_TXD1 : out slbit; -- pad-o: p1: transmit data (board view) - I_CTS1_N : in slbit; -- pad-i: p1: clear to send (act. low) - O_RTS1_N : out slbit -- pad-o: p1: request to send (act. low) - ); -end s3_rs232_iob_int_ext; - -architecture syn of s3_rs232_iob_int_ext is - signal RXD0 : slbit := '0'; - signal TXD0 : slbit := '0'; - signal RXD1 : slbit := '0'; - signal TXD1 : slbit := '0'; - signal CTS1_N : slbit := '0'; - signal RTS1_N : slbit := '0'; -begin - - P0 : s3_rs232_iob_int - port map ( - CLK => CLK, - RXD => RXD0, - TXD => TXD0, - I_RXD => I_RXD0, - O_TXD => O_TXD0 - ); - - P1 : s3_rs232_iob_ext - port map ( - CLK => CLK, - RXD => RXD1, - TXD => TXD1, - CTS_N => CTS1_N, - RTS_N => RTS1_N, - I_RXD => I_RXD1, - O_TXD => O_TXD1, - I_CTS_N => I_CTS1_N, - O_RTS_N => O_RTS1_N - ); - - proc_port_mux: process (SEL, RXD0, TXD, RXD1, CTS1_N, RTS_N) - begin - if SEL = '0' then -- use main board rs232, no flow cntl - RXD <= RXD0; -- get port 0 inputs - CTS_N <= '0'; - TXD0 <= TXD; -- set port 0 output - TXD1 <= '1'; -- port 1 outputs to idle state - RTS1_N <= '0'; - else -- otherwise use pmod1 rs232 - RXD <= RXD1; -- get port 1 inputs - CTS_N <= CTS1_N; - TXD1 <= TXD; -- set port 1 outputs - RTS1_N <= RTS_N; - TXD0 <= '1'; -- port 0 output to idle state - end if; - end process proc_port_mux; - -end syn; diff --git a/rtl/bplib/s3board/s3board_pins.ucf b/rtl/bplib/s3board/s3board_pins.ucf index 7854e19d..c55dcac5 100644 --- a/rtl/bplib/s3board/s3board_pins.ucf +++ b/rtl/bplib/s3board/s3board_pins.ucf @@ -1,9 +1,9 @@ -## $Id: s3board_pins.ucf 336 2010-11-06 18:28:27Z mueller $ +## $Id: s3board_pins.ucf 402 2011-08-05 18:56:44Z mueller $ ## ## Pin locks for S3BOARD core functionality: -## internal RS232 -## human I/O (switches, buttons, leds, display) -## sram +## - internal RS232 +## - human I/O (switches, buttons, leds, display) +## - sram ## ## Revision History: ## Date Rev Version Comment diff --git a/rtl/bplib/s3board/s3boardlib.vbom b/rtl/bplib/s3board/s3boardlib.vbom index bad5fc0d..2380ccfc 100644 --- a/rtl/bplib/s3board/s3boardlib.vbom +++ b/rtl/bplib/s3board/s3boardlib.vbom @@ -1,4 +1,3 @@ # libs ../../vlib/slvtypes.vhd -../../vlib/rbus/rblib.vhd s3boardlib.vhd diff --git a/rtl/bplib/s3board/s3boardlib.vhd b/rtl/bplib/s3board/s3boardlib.vhd index 78c89521..084faa64 100644 --- a/rtl/bplib/s3board/s3boardlib.vhd +++ b/rtl/bplib/s3board/s3boardlib.vhd @@ -1,6 +1,6 @@ --- $Id: s3boardlib.vhd 351 2010-12-30 21:50:54Z mueller $ +-- $Id: s3boardlib.vhd 391 2011-07-09 17:25:02Z mueller $ -- --- Copyright 2007-2010 by Walter F.J. Mueller +-- Copyright 2007-2011 by Walter F.J. Mueller -- -- 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 @@ -19,6 +19,9 @@ -- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4, 12.1; ghdl 0.18-0.29 -- Revision History: -- Date Rev Version Comment +-- 2011-07-09 391 1.3.5 move s3_rs232_iob_int_ext to bpgenlib +-- 2011-07-08 390 1.3.4 move s3_(dispdrv|humanio*) to bpgenlib +-- 2011-07-03 387 1.3.3 move s3_rs232_iob_(int|ext) to bpgenlib -- 2010-12-30 351 1.3.2 use rblib; rename human s3_humanio_rri -> _rbus -- 2010-11-06 336 1.3.1 rename input pin CLK -> I_CLK50 -- 2010-06-03 300 1.3 add s3_humanio_rri (now needs rrilib) @@ -41,7 +44,6 @@ use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use work.slvtypes.all; -use work.rblib.all; package s3boardlib is @@ -87,102 +89,6 @@ component s3board_fusp_aif is -- S3BOARD, abstract iface, base+fusp ); end component; -component s3_dispdrv is -- 7 segment display driver - generic ( - CDWIDTH : positive := 6); -- clk divider width (must be >= 5) - port ( - CLK : in slbit; -- clock - DIN : in slv16; -- data - DP : in slv4; -- decimal points - ANO_N : out slv4; -- anodes (act.low) - SEG_N : out slv8 -- segements (act.low) - ); -end component; - -component s3_humanio is -- human i/o handling: swi,btn,led,dsp - generic ( - DEBOUNCE : boolean := true); -- instantiate debouncer for SWI,BTN - port ( - CLK : in slbit; -- clock - RESET : in slbit; -- reset - CE_MSEC : in slbit; -- 1 ms clock enable - SWI : out slv8; -- switch settings, debounced - BTN : out slv4; -- button settings, debounced - LED : in slv8; -- led data - DSP_DAT : in slv16; -- display data - DSP_DP : in slv4; -- display decimal points - I_SWI : in slv8; -- pad-i: switches - I_BTN : in slv4; -- pad-i: buttons - O_LED : out slv8; -- pad-o: leds - O_ANO_N : out slv4; -- pad-o: 7 seg disp: anodes (act.low) - O_SEG_N : out slv8 -- pad-o: 7 seg disp: segments (act.low) - ); -end component; - -component s3_humanio_rbus is -- human i/o handling /w rbus intercept - generic ( - DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN - RB_ADDR : slv8 := conv_std_logic_vector(2#10000000#,8)); - port ( - CLK : in slbit; -- clock - RESET : in slbit; -- reset - CE_MSEC : in slbit; -- 1 ms clock enable - RB_MREQ : in rb_mreq_type; -- rbus: request - RB_SRES : out rb_sres_type; -- rbus: response - SWI : out slv8; -- switch settings, debounced - BTN : out slv4; -- button settings, debounced - LED : in slv8; -- led data - DSP_DAT : in slv16; -- display data - DSP_DP : in slv4; -- display decimal points - I_SWI : in slv8; -- pad-i: switches - I_BTN : in slv4; -- pad-i: buttons - O_LED : out slv8; -- pad-o: leds - O_ANO_N : out slv4; -- pad-o: 7 seg disp: anodes (act.low) - O_SEG_N : out slv8 -- pad-o: 7 seg disp: segments (act.low) - ); -end component; - -component s3_rs232_iob_int is -- iob's for internal rs232 - port ( - CLK : in slbit; -- clock - RXD : out slbit; -- receive data (board view) - TXD : in slbit; -- transmit data (board view) - I_RXD : in slbit; -- pad-i: receive data (board view) - O_TXD : out slbit -- pad-o: transmit data (board view) - ); -end component; - -component s3_rs232_iob_ext is -- iob's for external rs232 (Pmod) - port ( - CLK : in slbit; -- clock - RXD : out slbit; -- receive data (board view) - TXD : in slbit; -- transmit data (board view) - CTS_N : out slbit; -- clear to send (act. low) - RTS_N : in slbit; -- request to send (act. low) - I_RXD : in slbit; -- pad-i: receive data (board view) - O_TXD : out slbit; -- pad-o: transmit data (board view) - I_CTS_N : in slbit; -- pad-i: clear to send (act. low) - O_RTS_N : out slbit -- pad-o: request to send (act. low) - ); -end component; - -component s3_rs232_iob_int_ext is -- iob's for int+ext rs232, with select - port ( - CLK : in slbit; -- clock - SEL : in slbit; -- select, '0' for port 0 - RXD : out slbit; -- receive data (board view) - TXD : in slbit; -- transmit data (board view) - CTS_N : out slbit; -- clear to send (act. low) - RTS_N : in slbit; -- request to send (act. low) - I_RXD0 : in slbit; -- pad-i: p0: receive data (board view) - O_TXD0 : out slbit; -- pad-o: p0: transmit data (board view) - I_RXD1 : in slbit; -- pad-i: p1: receive data (board view) - O_TXD1 : out slbit; -- pad-o: p1: transmit data (board view) - I_CTS1_N : in slbit; -- pad-i: p1: clear to send (act. low) - O_RTS1_N : out slbit -- pad-o: p1: request to send (act. low) - ); -end component; - component s3_sram_dummy is -- SRAM protection dummy port ( O_MEM_CE_N : out slv2; -- sram: chip enables (act.low) @@ -218,4 +124,4 @@ component s3_sram_memctl is -- SRAM driver ); end component; -end s3boardlib; +end package s3boardlib; diff --git a/rtl/bplib/s3board/tb/Makefile b/rtl/bplib/s3board/tb/Makefile index abd003d5..96305c15 100644 --- a/rtl/bplib/s3board/tb/Makefile +++ b/rtl/bplib/s3board/tb/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.3 use includes from rtl/make # 2010-05-16 291 1.2.2 rename tb_memctl_s3sram->tb_s3_sram_memctl # 2010-05-01 286 1.2.1 add tb_s3board_usp_dummy # 2009-11-21 252 1.2 add ISim support @@ -12,7 +13,7 @@ EXE_all = tb_s3board_dummy tb_s3board_fusp_dummy tb_s3_sram_memctl # ISE_PATH = xc3s1000-ft256-4 # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -22,9 +23,9 @@ clean : ise_clean ghdl_clean isim_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.isim -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_isim.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/ibus/Makefile b/rtl/ibus/Makefile index 3c4b9c3f..718b2efd 100644 --- a/rtl/ibus/Makefile +++ b/rtl/ibus/Makefile @@ -1,13 +1,14 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2008-08-22 161 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -15,7 +16,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/Makefile.ghdl b/rtl/make/generic_ghdl.mk similarity index 88% rename from rtl/vlib/Makefile.ghdl rename to rtl/make/generic_ghdl.mk index 2986f887..824f944e 100644 --- a/rtl/vlib/Makefile.ghdl +++ b/rtl/make/generic_ghdl.mk @@ -1,7 +1,8 @@ -# $Id: Makefile.ghdl 284 2010-04-26 20:55:13Z mueller $ +# $Id: generic_ghdl.mk 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.3 renamed, moved to rtl/make; # 2007-11-04 95 1.2.2 fix find statement in ghdl_tmp_clean # 2007-11-02 94 1.2.1 don't delete cext_*.o in ghdl_tmp_clean # 2007-07-08 65 1.2 support now autobuilding of _fsim and _tsim models @@ -32,7 +33,7 @@ LINK.vhd = $(GHDL) -e $(GHDLIEEE) %.dep_ghdl: %.vbom vbomconv --dep_ghdl $< > $@ # -.phony: ghdl_clean ghdl_tmp_clean +.PHONY: ghdl_clean ghdl_tmp_clean # ghdl_clean: ghdl_tmp_clean rm -f $(EXE_all) diff --git a/rtl/vlib/Makefile.isim b/rtl/make/generic_isim.mk similarity index 88% rename from rtl/vlib/Makefile.isim rename to rtl/make/generic_isim.mk index 80fb19e7..a1716b76 100644 --- a/rtl/vlib/Makefile.isim +++ b/rtl/make/generic_isim.mk @@ -1,7 +1,8 @@ -# $Id: Makefile.isim 284 2010-04-26 20:55:13Z mueller $ +# $Id: generic_isim.mk 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.2 renamed, moved to rtl/make; # 2010-04-26 284 1.1 add _[sft]sim support # 2009-11-22 252 1.0 Initial version # @@ -34,7 +35,7 @@ FUSE = fuse %.dep_isim: %.vbom vbomconv --dep_isim $< > $@ # -.phony: isim_clean isim_tmp_clean +.PHONY: isim_clean isim_tmp_clean # isim_clean: isim_tmp_clean rm -f $(EXE_all:%=%_ISim) diff --git a/rtl/vlib/Makefile.xflow b/rtl/make/generic_xflow.mk similarity index 75% rename from rtl/vlib/Makefile.xflow rename to rtl/make/generic_xflow.mk index 9c285bd7..45ccac08 100644 --- a/rtl/vlib/Makefile.xflow +++ b/rtl/make/generic_xflow.mk @@ -1,7 +1,12 @@ -# $Id: Makefile.xflow 341 2010-11-27 23:05:43Z mueller $ +# $Id: generic_xflow.mk 406 2011-08-14 21:06:44Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-14 406 1.7.1 use isemsg_filter; new %.mfsum target +# 2011-08-13 405 1.7 renamed, moved to rtl/make; +# 2011-07-17 394 1.6.2 add rm *.svf to ise_clean rule +# 2011-07-11 392 1.6.1 use config_wrapper, support jtag via svf generation +# 2011-06-26 385 1.6 use ISE_PATH for vbomconv -xst_prj # 2010-11-26 340 1.5.8 fix path for .opt defaults (now rtl/vlib) # 2010-05-06 289 1.5.7 add xilinx_tsim_xon support # 2010-04-24 282 1.5.6 add %.impact rule to run impact_wrapper @@ -44,11 +49,11 @@ endif # setup defaults for xflow option files for synthesis and implementation # ifndef XFLOWOPT_SYN -XFLOWOPT_SYN = xst_vhdl.opt +XFLOWOPT_SYN = syn_s3_speed.opt endif # ifndef XFLOWOPT_IMP -XFLOWOPT_IMP = balanced.opt +XFLOWOPT_IMP = imp_s3_speed.opt endif # XFLOW = xflow -p ${ISE_PATH} @@ -67,20 +72,21 @@ XFLOW = xflow -p ${ISE_PATH} # %.ngc: %.vbom if [ ! -d ./ise ]; then mkdir ./ise; fi - (cd ./ise; vbomconv --xst_prj ../$< > $*.prj) + (cd ./ise; vbomconv --ise_path=${ISE_PATH} --xst_prj ../$< > $*.prj) (cd ./ise; touch $*.xcf) if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi - if [ -r ${RETROBASE}/rtl/vlib/${XFLOWOPT_SYN} ]; then \ - cp ${RETROBASE}/rtl/vlib/${XFLOWOPT_SYN} ./ise; fi + if [ -r ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ]; then \ + cp ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ./ise; fi if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi ${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj (cd ./ise; chmod -x *.* ) if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi @ echo "===============================================================" - @ echo "* Makefile.xflow: XST Diagnostic Summary *" + @ echo "* XST Diagnostic Summary *" @ echo "===============================================================" - @ grep -i -A 1 ":.*:" $*_xst.log || true + @ if [ -r $*.mfset ]; then isemsg_filter xst $*.mfset $*_xst.log; fi + @ if [ ! -r $*.mfset ]; then grep -i -A 1 ":.*:" $*_xst.log || true; fi @ echo "===============================================================" # # the following rule needed to generate an %_*sim.vhd in a ./tb sub-directory @@ -90,20 +96,21 @@ XFLOW = xflow -p ${ISE_PATH} (cd ./ise; vbomconv --xst_prj ../$< > $*.prj) (cd ./ise; touch $*.xcf) if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi - if [ -r ${RETROBASE}/rtl/vlib/${XFLOWOPT_SYN} ]; then \ - cp ${RETROBASE}/rtl/vlib/${XFLOWOPT_SYN} ./ise; fi + if [ -r ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ]; then \ + cp ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ./ise; fi if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi ${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj (cd ./ise; chmod -x *.* ) if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi @ echo "===============================================================" - @ echo "* Makefile.xflow: XST Diagnostic Summary *" + @ echo "* XST Diagnostic Summary *" @ echo "===============================================================" - @ grep -i -A 1 ":.*:" $*_xst.log || true + @ if [ -r $*.mfset ]; then isemsg_filter xst $*.mfset $*_xst.log; fi + @ if [ ! -r $*.mfset ]; then grep -i -A 1 ":.*:" $*_xst.log || true; fi @ echo "===============================================================" # -# Implement (map+par) +# Implement 1 (map+par) # input: %.ngc # %.ucf constraint file (if available) # output: %.ncd @@ -118,8 +125,8 @@ XFLOW = xflow -p ${ISE_PATH} if [ ! -d ./ise ]; then mkdir ./ise; fi if [ -r $*.ngc ]; then cp -p $*.ngc ./ise; fi if [ -r $*.ucf ]; then cp -p $*.ucf ./ise; fi - if [ -r ${RETROBASE}/rtl/vlib/${XFLOWOPT_IMP} ]; then \ - cp ${RETROBASE}/rtl/vlib/${XFLOWOPT_IMP} ./ise; fi + if [ -r ${RETROBASE}/rtl/make/${XFLOWOPT_IMP} ]; then \ + cp ${RETROBASE}/rtl/make/${XFLOWOPT_IMP} ./ise; fi if [ -r ${XFLOWOPT_IMP} ]; then cp -p ${XFLOWOPT_IMP} ./ise; fi ${XFLOW} -wd ise -implement ${XFLOWOPT_IMP} $< (cd ./ise; chmod -x *.* ) @@ -131,7 +138,7 @@ XFLOW = xflow -p ${ISE_PATH} if [ -r ./ise/$*_pad.txt ]; then cp -p ./ise/$*_pad.txt ./$*_pad.log; fi if [ -r ./ise/$*.twr ]; then cp -p ./ise/$*.twr ./$*_twr.log; fi # -# Configure (bitgen) +# Implement 2 (bitgen) # input: %.ncd # output: %.bit # %.msk @@ -146,13 +153,47 @@ XFLOW = xflow -p ${ISE_PATH} if [ -r ./ise/$*.msk ]; then cp -p ./ise/$*.msk .; fi if [ -r ./ise/$*.bgn ]; then cp -p ./ise/$*.bgn ./$*_bgn.log; fi # -# Program FPGA with impact +# Create svf from bitstream # input: %.bit -# output: .phony +# output: %.svf # -%.impact: %.bit - impact_wrapper --board=${ISE_BOARD} --path=${ISE_PATH} $*.bit +%.svf: %.bit + config_wrapper --board=${ISE_BOARD} --path=${ISE_PATH} bit2svf $*.bit +# +# Configure FPGA with impact +# input: %.bit +# output: .PHONY +# +%.iconfig: %.bit + config_wrapper --board=${ISE_BOARD} --path=${ISE_PATH} iconfig $*.bit + +# +# Configure FPGA with jtag +# input: %.svf +# output: .PHONY +# +%.jconfig: %.svf + config_wrapper --board=${ISE_BOARD} --path=${ISE_PATH} jconfig $*.svf + +# +# Print log file summary +# input: %_*.log (not depended) +# output: .PHONY +%.mfsum: %.mfset + @ echo "=== XST summary =============================================" + @ if [ -r $*_xst.log ]; then isemsg_filter xst $*.mfset $*_xst.log; fi + @ echo "=== Translate summary =======================================" + @ if [ -r $*_tra.log ]; then isemsg_filter tra $*.mfset $*_tra.log; fi + @ echo "=== MAP summary =============================================" + @ if [ -r $*_map.log ]; then isemsg_filter map $*.mfset $*_map.log; fi + @ echo "=== PAR summary =============================================" + @ if [ -r $*_par.log ]; then isemsg_filter par $*.mfset $*_par.log; fi + @ echo "=== Bitgen summary ==========================================" + @ if [ -r $*_bgn.log ]; then isemsg_filter bgn $*.mfset $*_bgn.log; fi + +# +# # # Post-XST simulation model (netgen -sim; UNISIM based) # input: %.ngc @@ -219,7 +260,7 @@ XFLOW = xflow -p ${ISE_PATH} cpp -I${RETROBASE}/rtl -MM $*.ucf_cpp |\ sed 's/\.o:/\.ucf:/' > $*.dep_ucf_cpp # -.phony : ise_clean ise_tmp_clean +.PHONY : ise_clean ise_tmp_clean # ise_clean: ise_tmp_clean rm -rf *.ngc @@ -227,6 +268,7 @@ ise_clean: ise_tmp_clean rm -rf *.pcf rm -rf *.bit rm -rf *.msk + rm -rf *.svf rm -rf *_[sft]sim.vhd rm -rf *_tsim.sdf rm -rf *_xst.log diff --git a/rtl/vlib/Makefile.xflow_cpld b/rtl/make/generic_xflow_cpld.mk similarity index 96% rename from rtl/vlib/Makefile.xflow_cpld rename to rtl/make/generic_xflow_cpld.mk index 412b7e2d..03252a5e 100644 --- a/rtl/vlib/Makefile.xflow_cpld +++ b/rtl/make/generic_xflow_cpld.mk @@ -1,7 +1,8 @@ -# $Id: Makefile.xflow_cpld 268 2010-03-14 22:41:18Z mueller $ +# $Id: generic_xflow_cpld.mk 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 renamed, moved to rtl/make; # 2010-03-13 268 1.0 Initial version, cloned from .xflow Rev 252 #--- # @@ -112,7 +113,7 @@ XFLOW = xflow -p ${ISE_PATH} %.dep_ucf_cpp : %.ucf_cpp cpp -MM $*.ucf_cpp | sed 's/\.o:/\.ucf:/' > $*.dep_ucf_cpp # -.phony : ise_clean ise_tmp_clean +.PHONY : ise_clean ise_tmp_clean # ise_clean: ise_tmp_clean rm -rf *.ngc diff --git a/rtl/sys_gen/w11a/nexys2/balanced.opt b/rtl/make/imp_s3_speed.opt similarity index 65% rename from rtl/sys_gen/w11a/nexys2/balanced.opt rename to rtl/make/imp_s3_speed.opt index 7566b41d..e23b38f7 100644 --- a/rtl/sys_gen/w11a/nexys2/balanced.opt +++ b/rtl/make/imp_s3_speed.opt @@ -1,13 +1,15 @@ FLOWTYPE = FPGA; -############################################################### -## Filename: balanced.opt -## -## Option File For Xilinx FPGA Implementation Flow -## -## Version: 8.1.1 -## $Header: /devl/xcs/repo/env/Jobs/Xflow/data/optionfiles/virtex_fpga_balanced.opt,v 1.14 2004/10/01 22:29:20 rvklair Exp $ -############################################################### # +# $Id: imp_s3_speed.opt 405 2011-08-14 08:16:28Z mueller $ +# +# Revision History: +# Date Rev Version Comment +# 2011-08-13 405 1.1 renamed, moved to rtl/make; +# 2007-07-20 67 1.0 Initial version +# +# Derived from ISE balanced.opt +# +# ---------------------------------------------------------------------------- # Options for Translator # # Type "ngdbuild -h" for a detailed list of ngdbuild command line options @@ -18,12 +20,12 @@ Program ngdbuild # source netlist is newer than existing # NGO file (default) -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -#-bm .bmm # Block RAM memory map file ; # User design - pick from xflow command line .ngd; # Name of NGD file. Filebase same as design filebase End Program ngdbuild # +# ---------------------------------------------------------------------------- # Options for Mapper # # Type "map -h " for a detailed list of map command line options @@ -31,17 +33,12 @@ End Program ngdbuild Program map -o _map.ncd; # Output Mapped ncd file -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -# -fp .mfp; # Floorplan file -# -gm incremental; # Guide mode -# -timing; # Perform Timing-Driven Packing and Placement -# -ol med; # Map Effort Levels. -ol [std|med|high] - # Note: If -timing is not specified, -ol switch is ignored. - # Device families supported: Virtex2, Virtex2P .ngd; # Input NGD file .pcf; # Physical constraints file END Program map # +# ---------------------------------------------------------------------------- # Options for Post Map Trace # # Type "trce -h" for a detailed list of trce command line options @@ -51,15 +48,12 @@ Program post_map_trce #-e 3; # Produce error report (limit 3 items/constraint) -xml _map.twx; # Output XML version of the timing report -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -#-o _map.twr; # Output trace report file -#-tsi _map.tsi; # Produce Timing Specification Interaction report -#-fastpaths; # Report minimum paths in verbose mode -#-nodatasheet; # Do not create the datasheet section of the report _map.ncd; # Input mapped ncd .pcf; # Physical constraints file END Program post_map_trce # +# ---------------------------------------------------------------------------- # Options for Place and Route # # Type "par -h" for a detailed list of par command line options @@ -69,13 +63,13 @@ Program par -ol high; # Overall effort level -xe n; # extra effort level -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -# -gm incremental; # Guide mode _map.ncd; # Input mapped NCD file .ncd; # Output placed and routed NCD .pcf; # Input physical constraints file END Program par # +# ---------------------------------------------------------------------------- # Options for Post Par Trace # # Type "trce -h" for a detailed list of trce command line options @@ -85,10 +79,6 @@ Program post_par_trce #-e 3; # Produce error report (limit 3 items/constraint) -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -xml .twx; # Output XML version of the timing report -#-o .twr; # Output trace report file -#-tsi .tsi; # Produce Timing Specification Interaction report -#-fastpaths; # Report minimum paths in verbose mode -#-nodatasheet; # Do not create the datasheet section of the report .ncd; # Input placed and routed ncd .pcf; # Physical constraints file END Program post_par_trce diff --git a/rtl/vlib/balanced.opt b/rtl/make/imp_s3_speed_maptd.opt similarity index 65% rename from rtl/vlib/balanced.opt rename to rtl/make/imp_s3_speed_maptd.opt index 171c88dc..f0e0f1ed 100644 --- a/rtl/vlib/balanced.opt +++ b/rtl/make/imp_s3_speed_maptd.opt @@ -1,13 +1,16 @@ FLOWTYPE = FPGA; -############################################################### -## Filename: balanced.opt -## -## Option File For Xilinx FPGA Implementation Flow -## -## Version: 8.1.1 -## $Header: /devl/xcs/repo/env/Jobs/Xflow/data/optionfiles/virtex_fpga_balanced.opt,v 1.14 2004/10/01 22:29:20 rvklair Exp $ -############################################################### # +# $Id: imp_s3_speed_maptd.opt 405 2011-08-14 08:16:28Z mueller $ +# +# Revision History: +# Date Rev Version Comment +# 2011-08-13 405 1.1 renamed, moved to rtl/make; +# 2007-07-20 67 1.0 Initial version +# +# Derived from ISE balanced.opt +# Uses timing driven map like 'mapphyssynthesis' SmartExplorer strategy +# +# ---------------------------------------------------------------------------- # Options for Translator # # Type "ngdbuild -h" for a detailed list of ngdbuild command line options @@ -18,12 +21,12 @@ Program ngdbuild # source netlist is newer than existing # NGO file (default) -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -#-bm .bmm # Block RAM memory map file ; # User design - pick from xflow command line .ngd; # Name of NGD file. Filebase same as design filebase End Program ngdbuild # +# ---------------------------------------------------------------------------- # Options for Mapper # # Type "map -h " for a detailed list of map command line options @@ -31,17 +34,17 @@ End Program ngdbuild Program map -o _map.ncd; # Output Mapped ncd file -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -# -fp .mfp; # Floorplan file -# -gm incremental; # Guide mode -# -timing; # Perform Timing-Driven Packing and Placement -# -ol med; # Map Effort Levels. -ol [std|med|high] - # Note: If -timing is not specified, -ol switch is ignored. - # Device families supported: Virtex2, Virtex2P +-timing; # Perform a timing-driven packing +-ol high; # Effort level +-xe n; # Extra effort level for timing-driven packing (normal) +-register_duplication on;# Duplicate registers/luts during timing-driven packing +-logic_opt on; # Perform physical synthesis combinatorial logic opt. .ngd; # Input NGD file .pcf; # Physical constraints file END Program map # +# ---------------------------------------------------------------------------- # Options for Post Map Trace # # Type "trce -h" for a detailed list of trce command line options @@ -51,15 +54,12 @@ Program post_map_trce #-e 3; # Produce error report (limit 3 items/constraint) -xml _map.twx; # Output XML version of the timing report -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -#-o _map.twr; # Output trace report file -#-tsi _map.tsi; # Produce Timing Specification Interaction report -#-fastpaths; # Report minimum paths in verbose mode -#-nodatasheet; # Do not create the datasheet section of the report _map.ncd; # Input mapped ncd .pcf; # Physical constraints file END Program post_map_trce # +# ---------------------------------------------------------------------------- # Options for Place and Route # # Type "par -h" for a detailed list of par command line options @@ -67,14 +67,15 @@ END Program post_map_trce Program par -w; # Overwrite existing placed and routed ncd -ol high; # Overall effort level +-xe n; # Extra effort level -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -# -gm incremental; # Guide mode _map.ncd; # Input mapped NCD file .ncd; # Output placed and routed NCD .pcf; # Input physical constraints file END Program par # +# ---------------------------------------------------------------------------- # Options for Post Par Trace # # Type "trce -h" for a detailed list of trce command line options @@ -84,10 +85,6 @@ Program post_par_trce #-e 3; # Produce error report (limit 3 items/constraint) -intstyle xflow; # Message Reporting Style: ise, xflow, or silent -xml .twx; # Output XML version of the timing report -#-o .twr; # Output trace report file -#-tsi .tsi; # Produce Timing Specification Interaction report -#-fastpaths; # Report minimum paths in verbose mode -#-nodatasheet; # Do not create the datasheet section of the report .ncd; # Input placed and routed ncd .pcf; # Physical constraints file END Program post_par_trce diff --git a/rtl/make/imp_s6_speed.opt b/rtl/make/imp_s6_speed.opt new file mode 100644 index 00000000..da2c4fa3 --- /dev/null +++ b/rtl/make/imp_s6_speed.opt @@ -0,0 +1,92 @@ +FLOWTYPE = FPGA; +# +# $Id: imp_s6_speed.opt 405 2011-08-14 08:16:28Z mueller $ +# +# Revision History: +# Date Rev Version Comment +# 2011-08-13 405 1.0 Initial version +# +# Derived from ISE balanced.opt +# Uses uses settings like 'mapgloboptlogoptregdup' SmartExplorer strategy +# +# ---------------------------------------------------------------------------- +# Options for Translator +# +# Type "ngdbuild -h" for a detailed list of ngdbuild command line options +# +Program ngdbuild +-p ; # Partname to use - picked from xflow commandline +-nt timestamp; # NGO File generation. Regenerate only when + # source netlist is newer than existing + # NGO file (default) +-intstyle xflow; # Message Reporting Style: ise, xflow, or silent +; # User design - pick from xflow command line +.ngd; # Name of NGD file. Filebase same as design filebase +End Program ngdbuild + +# +# ---------------------------------------------------------------------------- +# Options for Mapper +# +# Type "map -h " for a detailed list of map command line options +# +Program map +-o _map.ncd; # Output Mapped ncd file +-intstyle xflow; # Message Reporting Style: ise, xflow, or silent +-ol high; # Effort level +-xe n; # Extra effort level for timing-driven packing (normal) +-global_opt speed; # Perform global optimization before mapping +-logic_opt on; # Perform physical synthesis combinatorial logic opt. +-register_duplication on;# Duplicate registers/luts during timing-driven packing +-w; # Always overwrite any existing output files +.ngd; # Input NGD file +.pcf; # Physical constraints file +END Program map + +# +# ---------------------------------------------------------------------------- +# Options for Post Map Trace +# +# Type "trce -h" for a detailed list of trce command line options +# +Program post_map_trce +-v 3; # Produce verbose timing report +#-e 3; # Produce error report (limit 3 items/constraint) +-xml _map.twx; # Output XML version of the timing report +-intstyle xflow; # Message Reporting Style: ise, xflow, or silent +_map.ncd; # Input mapped ncd +.pcf; # Physical constraints file +END Program post_map_trce + +# +# ---------------------------------------------------------------------------- +# Options for Place and Route +# +# Type "par -h" for a detailed list of par command line options +# +Program par +-w; # Overwrite existing placed and routed ncd +-ol high; # Overall effort level +-xe n; # extra effort level +-intstyle xflow; # Message Reporting Style: ise, xflow, or silent +_map.ncd; # Input mapped NCD file +.ncd; # Output placed and routed NCD +.pcf; # Input physical constraints file +END Program par + +# +# ---------------------------------------------------------------------------- +# Options for Post Par Trace +# +# Type "trce -h" for a detailed list of trce command line options +# +Program post_par_trce +-v 3; # Produce verbose timing report +#-e 3; # Produce error report (limit 3 items/constraint) +-intstyle xflow; # Message Reporting Style: ise, xflow, or silent +-xml .twx; # Output XML version of the timing report +.ncd; # Input placed and routed ncd +.pcf; # Physical constraints file +END Program post_par_trce + + diff --git a/rtl/make/syn_s3_speed.opt b/rtl/make/syn_s3_speed.opt new file mode 100644 index 00000000..b50c2ac2 --- /dev/null +++ b/rtl/make/syn_s3_speed.opt @@ -0,0 +1,40 @@ +FLOWTYPE = FPGA_SYNTHESIS; +# +# $Id: syn_s3_speed.opt 405 2011-08-14 08:16:28Z mueller $ +# +# Revision History: +# Date Rev Version Comment +# 2011-08-13 405 1.1 renamed, moved to rtl/make; +# 2007-07-20 67 1.0 Initial version +# +# Derived from ISE xst_vhdl.opt +# +# ---------------------------------------------------------------------------- +# Options for XST +# +Program xst +-ifn _xst.scr; # input XST script file +-ofn _xst.log; # output XST log file +-intstyle xflow; # Message Reporting Style +# +# ParamFile lists the XST Properties that can be set by the user. +# +ParamFile: _xst.scr +"run"; +# +# Global Synthesis Options +# +"-ifn "; # Input/Project File Name +"-ifmt VHDL"; # Input Format (Verilog or VHDL) +"-ofn "; # Output File Name +"-ofmt ngc"; # Output File Format +"-p "; # Target Device +"-opt_mode SPEED"; # Optimization Criteria # AREA or SPEED +"-opt_level 2"; # Optimization Effort Criteria: 2=High +"-uc .xcf"; # Constraint File name +# +# The following are HDL Options +# +End ParamFile +End Program xst +# diff --git a/rtl/make/syn_s6_speed.opt b/rtl/make/syn_s6_speed.opt new file mode 100644 index 00000000..a60dfc5b --- /dev/null +++ b/rtl/make/syn_s6_speed.opt @@ -0,0 +1,40 @@ +FLOWTYPE = FPGA_SYNTHESIS; +# +# $Id: syn_s6_speed.opt 405 2011-08-14 08:16:28Z mueller $ +# +# Revision History: +# Date Rev Version Comment +# 2011-08-13 405 1.0 Initial version +# +# Derived from ISE xst_mixed.opt +# +# ---------------------------------------------------------------------------- +# Options for XST +# +Program xst +-ifn _xst.scr; # input XST script file +-ofn _xst.log; # output XST log file +-intstyle xflow; # Message Reporting Style +# +# ParamFile lists the XST Properties that can be set by the user. +# +ParamFile: _xst.scr +"run"; +# +# Global Synthesis Options +# +"-ifn "; # Input/Project File Name +"-ifmt mixed"; # Input Format (Verilog and VHDL) +"-ofn "; # Output File Name +"-ofmt ngc"; # Output File Format +"-top "; # Top Design Name +"-p "; # Target Device +"-opt_mode SPEED"; # Optimization Criteria # AREA or SPEED +"-opt_level 2"; # Optimization Effort Criteria: 2=High +"-uc .xcf"; # Constraint File name +# +# The following are HDL Options +# +End ParamFile +End Program xst +# diff --git a/rtl/sys_gen/tst_rlink/nexys2/.cvsignore b/rtl/sys_gen/tst_rlink/nexys2/.cvsignore index 37cfca74..484b4545 100644 --- a/rtl/sys_gen/tst_rlink/nexys2/.cvsignore +++ b/rtl/sys_gen/tst_rlink/nexys2/.cvsignore @@ -1,3 +1,4 @@ _impactbatch.log sys_tst_rlink_n2.ucf *.dep_ucf_cpp +*.svf diff --git a/rtl/sys_gen/tst_rlink/nexys2/Makefile b/rtl/sys_gen/tst_rlink/nexys2/Makefile index c374c853..3a55ee26 100644 --- a/rtl/sys_gen/tst_rlink/nexys2/Makefile +++ b/rtl/sys_gen/tst_rlink/nexys2/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 351 2010-12-30 21:50:54Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2010-12-29 351 1.0 Initial version # VBOM_all = $(wildcard *.vbom) @@ -10,7 +11,7 @@ BIT_all = $(VBOM_all:.vbom=.bit) ISE_BOARD = nexys2 ISE_PATH = xc3s1200e-fg320-4 # -.phony : all clean +.PHONY : all clean # all : $(BIT_all) # @@ -24,8 +25,8 @@ sys_tst_rlink_n2.mcs : sys_tst_rlink_n2.bit # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow -include $(RETROBASE)/rtl/vlib/Makefile.ghdl +include $(RETROBASE)/rtl/make/generic_xflow.mk +include $(RETROBASE)/rtl/make/generic_ghdl.mk # include $(VBOM_all:.vbom=.dep_xst) include $(VBOM_all:.vbom=.dep_ghdl) diff --git a/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.mfset b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.mfset new file mode 100644 index 00000000..aa3ece0b --- /dev/null +++ b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.mfset @@ -0,0 +1,63 @@ +# $Id: sys_tst_rlink_n2.mfset 406 2011-08-14 21:06:44Z mueller $ +# +# ---------------------------------------------------------------------------- +[xst] +INFO:.*Mux is complete : default of case is discarded + +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected + +Unconnected output port 'LOCKED' of component 'dcm_sp_sfs' +Unconnected output port 'OFIFO_SIZE' of component 'rlink_base' +Unconnected output port 'DOA' of component 'ram_1swar_1ar_gen' +Unconnected output port 'DOB' of component 'ram_2swsr_wfirst_gen' + +Input is never used +Input > is never used +Input is never used +Input is never used +Input is never used + +Signal > is assigned but never used +Signal is assigned but never used +Signal > is assigned but never used +ignal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal > is assigned but never used +Signal > is assigned but never used +Signal > is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used + +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent + +FF/Latch has a constant value of 0 +FF/Latch has a constant value of 0 + +# +# ---------------------------------------------------------------------------- +[tra] + +# +# ---------------------------------------------------------------------------- +[map] +The signal is incomplete +Logical network I_MEM_WAIT_IBUF has no load +INFO:.* + +# +# ---------------------------------------------------------------------------- +[par] +The signal I_MEM_WAIT_IBUF has no load +There are 1 loadless signals in this design +# +# ---------------------------------------------------------------------------- +[bgn] +Spartan-3 1200E and 1600E devices do not support bitstream +The signal is incomplete \ No newline at end of file diff --git a/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.ucf_cpp b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.ucf_cpp index dbddae4a..9a59fb00 100644 --- a/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.ucf_cpp +++ b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.ucf_cpp @@ -1,4 +1,4 @@ -## $Id: mueller $ +## $Id: sys_tst_rlink_n2.ucf_cpp 403 2011-08-06 17:36:22Z mueller $ ## ## Revision History: ## Date Rev Version Comment diff --git a/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vbom b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vbom index ff7cb79f..2c69524d 100644 --- a/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vbom +++ b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vbom @@ -2,14 +2,17 @@ ../../../vlib/slvtypes.vhd ../../../vlib/xlib/xlib.vhd ../../../vlib/genlib/genlib.vhd -../../../bplib/s3board/s3boardlib.vbom +../../../vlib/rbus/rblib.vhd +../../../vlib/rlink/rlinklib.vbom +../../../bplib/bpgen/bpgenlib.vbom ../../../bplib/nexys2/nexys2lib.vhd sys_conf : sys_conf.vhd # components [xst,isim]../../../vlib/xlib/dcm_sp_sfs_unisim.vbom [ghdl]../../../vlib/xlib/dcm_sp_sfs_gsim.vbom ../../../vlib/genlib/clkdivce.vbom -../../../bplib/s3board/s3_rs232_iob_int_ext.vbom +../../../bplib/bpgen/bp_rs232_2l4l_iob.vbom +../../../bplib/bpgen/sn_humanio_rbus.vbom ../tst_rlink.vbom ../../../bplib/nexys2/n2_cram_dummy.vbom # design diff --git a/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vhd b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vhd index 93c066e2..56b6306f 100644 --- a/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vhd +++ b/rtl/sys_gen/tst_rlink/nexys2/sys_tst_rlink_n2.vhd @@ -1,4 +1,4 @@ --- $Id: sys_tst_rlink_n2.vhd 375 2011-04-02 07:56:47Z mueller $ +-- $Id: sys_tst_rlink_n2.vhd 406 2011-08-14 21:06:44Z mueller $ -- -- Copyright 2010-2011 by Walter F.J. Mueller -- @@ -17,7 +17,9 @@ -- -- Dependencies: vlib/xlib/dcm_sp_sfs -- vlib/genlib/clkdivce --- bplib/s3board/s3_rs232_iob_int_ext +-- bplib/bpgen/bp_rs232_2l4l_iob +-- bplib/bpgen/sn_humanio_rbus +-- tst_rlink -- vlib/nexys2/n2_cram_dummy -- -- Test bench: tb/tb_tst_rlink_n2 @@ -27,13 +29,33 @@ -- -- Synthesized (xst): -- Date Rev ise Target flop lutl lutm slic t peri +-- 2011-06-26 385 12.1 M53d xc3s1200e-4 688 1500 68 993 t 16.2 -- 2011-04-02 375 12.1 M53d xc3s1200e-4 688 1572 68 994 t 13.8 -- 2010-12-29 351 12.1 M53d xc3s1200e-4 604 1298 68 851 t 14.7 -- -- Revision History: -- Date Rev Version Comment +-- 2011-07-09 391 1.1.2 use now bp_rs232_2l4l_iob +-- 2011-07-08 390 1.1.1 use now sn_humanio +-- 2011-06-26 385 1.1 move s3_humanio_rbus from tst_rlink to top level -- 2010-12-29 351 1.0 Initial version ------------------------------------------------------------------------------ +-- Usage of Nexys 2 Switches, Buttons, LEDs: +-- +-- SWI(0): 0 -> main board RS232 port - implemented in bp_rs232_2l4l_iob +-- 1 -> Pmod B/top RS232 port / +-- (1:7): no function (only connected to s3_humanio_rbus) +-- +-- LED(0): timer 0 busy +-- LED(1): timer 1 busy +-- LED(2:6): no function (only connected to s3_humanio_rbus) +-- LED(7): RL_SER_MONI.abact +-- +-- DSP: RL_SER_MONI.clkdiv (from auto bauder) +-- DP(0): RL_SER_MONI.rxact +-- DP(1): RTS_N (shows rx back preasure) +-- DP(2): RL_SER_MONI.txact +-- DP(3): CTS_N (shows tx back preasure) -- library ieee; @@ -43,7 +65,9 @@ use ieee.std_logic_arith.all; use work.slvtypes.all; use work.xlib.all; use work.genlib.all; -use work.s3boardlib.all; +use work.rblib.all; +use work.rlinklib.all; +use work.bpgenlib.all; use work.nexys2lib.all; use work.sys_conf.all; @@ -90,16 +114,28 @@ architecture syn of sys_tst_rlink_n2 is signal SWI : slv8 := (others=>'0'); signal BTN : slv4 := (others=>'0'); + signal LED : slv8 := (others=>'0'); + signal DSP_DAT : slv16 := (others=>'0'); + signal DSP_DP : slv4 := (others=>'0'); signal RESET : slbit := '0'; signal CE_USEC : slbit := '0'; signal CE_MSEC : slbit := '0'; + signal RB_MREQ_TOP : rb_mreq_type := rb_mreq_init; + signal RB_SRES_TOP : rb_sres_type := rb_sres_init; + signal RL_SER_MONI : rl_ser_moni_type := rl_ser_moni_init; + signal STAT : slv8 := (others=>'0'); + + constant rbaddr_hio : slv8 := "11000000"; -- 110000xx + begin assert (sys_conf_clksys mod 1000000) = 0 report "assert sys_conf_clksys on MHz grid" severity failure; + + RESET <= '0'; -- so far not used DCM : dcm_sp_sfs generic map ( @@ -125,9 +161,10 @@ begin CE_MSEC => CE_MSEC ); - IOB_RS232 : s3_rs232_iob_int_ext + IOB_RS232 : bp_rs232_2l4l_iob port map ( CLK => CLK, + RESET => '0', SEL => SWI(0), RXD => RXD, TXD => TXD, @@ -141,21 +178,21 @@ begin O_RTS1_N => O_FUSP_RTS_N ); - RLTEST : entity work.tst_rlink + HIO : sn_humanio_rbus generic map ( DEBOUNCE => sys_conf_hio_debounce, - CDINIT => sys_conf_ser2rri_cdinit) + RB_ADDR => rbaddr_hio) port map ( CLK => CLK, RESET => RESET, - CE_USEC => CE_USEC, CE_MSEC => CE_MSEC, - RXD => RXD, - TXD => TXD, - CTS_N => CTS_N, - RTS_N => RTS_N, + RB_MREQ => RB_MREQ_TOP, + RB_SRES => RB_SRES_TOP, SWI => SWI, BTN => BTN, + LED => LED, + DSP_DAT => DSP_DAT, + DSP_DP => DSP_DP, I_SWI => I_SWI, I_BTN => I_BTN, O_LED => O_LED, @@ -163,6 +200,24 @@ begin O_SEG_N => O_SEG_N ); + RLTEST : entity work.tst_rlink + generic map ( + CDINIT => sys_conf_ser2rri_cdinit) + port map ( + CLK => CLK, + RESET => RESET, + CE_USEC => CE_USEC, + CE_MSEC => CE_MSEC, + RXD => RXD, + TXD => TXD, + CTS_N => CTS_N, + RTS_N => RTS_N, + RB_MREQ_TOP => RB_MREQ_TOP, + RB_SRES_TOP => RB_SRES_TOP, + RL_SER_MONI => RL_SER_MONI, + STAT => STAT + ); + SRAM_PROT : n2_cram_dummy -- connect CRAM to protection dummy port map ( O_MEM_CE_N => O_MEM_CE_N, @@ -177,5 +232,16 @@ begin O_MEM_ADDR => O_MEM_ADDR, IO_MEM_DATA => IO_MEM_DATA ); - + + DSP_DAT <= RL_SER_MONI.clkdiv; + DSP_DP(0) <= RL_SER_MONI.rxact; + DSP_DP(1) <= RTS_N; + DSP_DP(2) <= RL_SER_MONI.txact; + DSP_DP(3) <= CTS_N; + + LED(7) <= RL_SER_MONI.abact; + LED(6 downto 2) <= (others=>'0'); + LED(1) <= STAT(1); + LED(0) <= STAT(0); + end syn; diff --git a/rtl/sys_gen/tst_rlink/nexys2/tb/Makefile b/rtl/sys_gen/tst_rlink/nexys2/tb/Makefile index 6e929071..fc5ad330 100644 --- a/rtl/sys_gen/tst_rlink/nexys2/tb/Makefile +++ b/rtl/sys_gen/tst_rlink/nexys2/tb/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 351 2010-12-30 21:50:54Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2010-12-29 351 1.0 Initial version # EXE_all = tb_tst_rlink_n2 # ISE_PATH = xc3s1200e-fg320-4 # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -19,8 +20,8 @@ clean : ise_clean ghdl_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/sys_gen/tst_rlink/tst_rlink.vbom b/rtl/sys_gen/tst_rlink/tst_rlink.vbom index a3ea6345..bc1e17cd 100644 --- a/rtl/sys_gen/tst_rlink/tst_rlink.vbom +++ b/rtl/sys_gen/tst_rlink/tst_rlink.vbom @@ -3,7 +3,6 @@ ../../vlib/rbus/rblib.vhd ../../vlib/rbus/rbdlib.vhd ../../vlib/rlink/rlinklib.vbom -../../bplib/s3board/s3boardlib.vhd # components ../../vlib/rlink/rlink_base_serport.vbom ../../vlib/rbus/rbd_tester.vbom @@ -11,7 +10,6 @@ ../../vlib/rbus/rbd_rbmon.vbom ../../vlib/rbus/rbd_eyemon.vbom ../../vlib/rbus/rbd_timer.vbom -../../bplib/s3board/s3_humanio_rbus.vbom ../../vlib/rbus/rb_sres_or_4.vbom # design tst_rlink.vhd diff --git a/rtl/sys_gen/tst_rlink/tst_rlink.vhd b/rtl/sys_gen/tst_rlink/tst_rlink.vhd index bc2cc36a..54e807ed 100644 --- a/rtl/sys_gen/tst_rlink/tst_rlink.vhd +++ b/rtl/sys_gen/tst_rlink/tst_rlink.vhd @@ -1,6 +1,6 @@ --- $Id: tst_rlink.vhd 375 2011-04-02 07:56:47Z mueller $ +-- $Id: tst_rlink.vhd 385 2011-06-26 22:10:57Z mueller $ -- --- Copyright 2010- by Walter F.J. Mueller +-- Copyright 2010-2011 by Walter F.J. Mueller -- -- 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 @@ -21,7 +21,6 @@ -- rbus/rbd_rbmon -- rbus/rbd_eyemon -- rbus/rbd_timer --- s3board/s3_humanio_rbus -- rbus/rb_sres_or_4 -- -- Test bench: nexys2/tb/tb_tst_rlink_n2 @@ -31,24 +30,15 @@ -- -- Revision History: -- Date Rev Version Comment +-- 2011-06-26 385 1.1 remove s3_humanio_rbus (will be in board design); +-- remove hio interface ports, add rbus ports -- 2011-04-02 375 1.0.1 add rbd_eyemon and two timer -- 2010-12-29 351 1.0 Initial version (inspired by sys_tst_rri) ------------------------------------------------------------------------------ --- Usage of Nexys 2 Switches, Buttons, LEDs: --- --- SWI(0): 0 -> main board RS232 port - implemented in sys_tst_rlink_* --- 1 -> Pmod B/top RS232 port / --- (1:7): no function (only connected to s3_humanio_rbus) --- --- LED(0): timer 0 busy --- LED(1): timer 1 busy --- LED(2:7): no function (only connected to s3_humanio_rbus) --- --- DSP: RL_SER_MONI.clkdiv (from auto bauder) --- DP(0): RXSD (inverted to signal activity) --- DP(1): RTS_N (shows rx back preasure) --- DP(2): TXSD (inverted to signal activity) --- DP(3): CTS_N (shows tx back preasure) +-- Usage of STAT signal: +-- STAT(0): timer 0 busy +-- STAT(1): timer 1 busy +-- STAT(2:7): unused library ieee; use ieee.std_logic_1164.all; @@ -58,13 +48,11 @@ use work.slvtypes.all; use work.rblib.all; use work.rbdlib.all; use work.rlinklib.all; -use work.s3boardlib.all; -- ---------------------------------------------------------------------------- entity tst_rlink is -- tester for rlink generic ( - DEBOUNCE : boolean := true; CDINIT : natural := 15); port ( CLK : in slbit; -- clock @@ -75,26 +63,15 @@ entity tst_rlink is -- tester for rlink TXD : out slbit; -- transmit data (board view) CTS_N : in slbit; -- rs232 cts_n RTS_N : out slbit; -- rs232 rts_n - SWI : out slv8; -- switches (for top cntl) - BTN : out slv4; -- buttons (for top cntl) - I_SWI : in slv8; -- s3 switches - I_BTN : in slv4; -- s3 buttons - O_LED : out slv8; -- s3 leds - O_ANO_N : out slv4; -- 7 segment disp: anodes (act.low) - O_SEG_N : out slv8 -- 7 segment disp: segments (act.low) + RB_MREQ_TOP : out rb_mreq_type; -- rbus: request to top + RB_SRES_TOP : in rb_sres_type; -- rbus: response from top + RL_SER_MONI: out rl_ser_moni_type; -- rlink monitor + STAT : out slv8 -- status flags ); end tst_rlink; architecture syn of tst_rlink is - signal RTS_N_L : slbit := '0'; - signal DSP_DAT : slv16 := (others=>'0'); - signal DSP_DP : slv4 := (others=>'0'); - - signal SWI_L : slv8 := (others=>'0'); - signal BTN_L : slv4 := (others=>'0'); - signal LED : slv8 := (others=>'0'); - signal RB_MREQ : rb_mreq_type := rb_mreq_init; signal RB_SRES : rb_sres_type := rb_sres_init; signal RB_SRES_TEST : rb_sres_type := rb_sres_init; @@ -103,7 +80,6 @@ architecture syn of tst_rlink is signal RB_SRES_EMON : rb_sres_type := rb_sres_init; signal RB_SRES_TIM0 : rb_sres_type := rb_sres_init; signal RB_SRES_TIM1 : rb_sres_type := rb_sres_init; - signal RB_SRES_HIO : rb_sres_type := rb_sres_init; signal RB_SRES_SUM1 : rb_sres_type := rb_sres_init; signal RB_LAM : slv16 := (others=>'0'); @@ -117,7 +93,7 @@ architecture syn of tst_rlink is signal TIM1_BUSY : slbit := '0'; signal RL_MONI : rl_moni_type := rl_moni_init; - signal RL_SER_MONI : rl_ser_moni_type := rl_ser_moni_init; + signal RL_SER_MONI_L : rl_ser_moni_type := rl_ser_moni_init; constant rbaddr_mon : slv8 := "11111100"; -- 111111xx constant rbaddr_emon : slv8 := "11111000"; -- 111110xx @@ -125,7 +101,6 @@ architecture syn of tst_rlink is constant rbaddr_test : slv8 := "11110000"; -- 111100xx constant rbaddr_tim1 : slv8 := "11100001"; -- 11100001 constant rbaddr_tim0 : slv8 := "11100000"; -- 11100000 - constant rbaddr_hio : slv8 := "11000000"; -- 110000xx begin @@ -150,13 +125,13 @@ begin RXSD => RXD, TXSD => TXD, CTS_N => CTS_N, - RTS_N => RTS_N_L, + RTS_N => RTS_N, RB_MREQ => RB_MREQ, RB_SRES => RB_SRES, RB_LAM => RB_LAM, RB_STAT => RB_STAT, RL_MONI => RL_MONI, - RL_SER_MONI => RL_SER_MONI + RL_SER_MONI => RL_SER_MONI_L ); RB_LAM(15 downto 2) <= RB_LAM_TEST(15 downto 2); @@ -207,7 +182,7 @@ begin RB_MREQ => RB_MREQ, RB_SRES => RB_SRES_EMON, RXSD => RXD, - RXACT => RL_SER_MONI.rxact + RXACT => RL_SER_MONI_L.rxact ); TIM0 : rbd_timer @@ -236,34 +211,12 @@ begin BUSY => TIM1_BUSY ); - HIO : s3_humanio_rbus - generic map ( - DEBOUNCE => DEBOUNCE, - RB_ADDR => rbaddr_hio) - port map ( - CLK => CLK, - RESET => RESET, - CE_MSEC => CE_MSEC, - RB_MREQ => RB_MREQ, - RB_SRES => RB_SRES_HIO, - SWI => SWI_L, - BTN => BTN_L, - LED => LED, - DSP_DAT => DSP_DAT, - DSP_DP => DSP_DP, - I_SWI => I_SWI, - I_BTN => I_BTN, - O_LED => O_LED, - O_ANO_N => O_ANO_N, - O_SEG_N => O_SEG_N - ); - RB_SRES_OR1 : rb_sres_or_4 port map ( RB_SRES_1 => RB_SRES_TEST, RB_SRES_2 => RB_SRES_BRAM, RB_SRES_3 => RB_SRES_MON, - RB_SRES_4 => RB_SRES_HIO, + RB_SRES_4 => RB_SRES_TOP, RB_SRES_OR => RB_SRES_SUM1 ); @@ -276,18 +229,11 @@ begin RB_SRES_OR => RB_SRES ); - DSP_DAT <= RL_SER_MONI.clkdiv; - DSP_DP(0) <= RL_SER_MONI.rxact; - DSP_DP(1) <= RTS_N_L; - DSP_DP(2) <= RL_SER_MONI.txact; - DSP_DP(3) <= CTS_N; + RB_MREQ_TOP <= RB_MREQ; + RL_SER_MONI <= RL_SER_MONI_L; - LED(0) <= TIM0_BUSY; - LED(1) <= TIM1_BUSY; - LED(7) <= RL_SER_MONI.abact; - - RTS_N <= RTS_N_L; - SWI <= SWI_L; - BTN <= BTN_L; - + STAT(0) <= TIM0_BUSY; + STAT(1) <= TIM1_BUSY; + STAT(7 downto 2) <= (others=>'0'); + end syn; diff --git a/rtl/sys_gen/w11a/nexys2/Makefile b/rtl/sys_gen/w11a/nexys2/Makefile index 77fa74d3..776647c8 100644 --- a/rtl/sys_gen/w11a/nexys2/Makefile +++ b/rtl/sys_gen/w11a/nexys2/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2010-05-28 295 1.0 Initial version (derived from _s3 version) # VBOM_all = $(wildcard *.vbom) @@ -10,7 +11,7 @@ BIT_all = $(VBOM_all:.vbom=.bit) ISE_BOARD = nexys2 ISE_PATH = xc3s1200e-fg320-4 # -.phony : all clean +.PHONY : all clean # all : $(BIT_all) # @@ -24,8 +25,8 @@ sys_w11a_n2.mcs : sys_w11a_n2.bit # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow -include $(RETROBASE)/rtl/vlib/Makefile.ghdl +include $(RETROBASE)/rtl/make/generic_xflow.mk +include $(RETROBASE)/rtl/make/generic_ghdl.mk # include $(VBOM_all:.vbom=.dep_xst) include $(VBOM_all:.vbom=.dep_ghdl) diff --git a/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.mfset b/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.mfset new file mode 100644 index 00000000..96688af9 --- /dev/null +++ b/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.mfset @@ -0,0 +1,148 @@ +# $Id: sys_w11a_n2.mfset 406 2011-08-14 21:06:44Z mueller $ +# +# ---------------------------------------------------------------------------- +[xst] +INFO:.*Mux is complete : default of case is discarded +INFO:.*You can improve the performance of the multiplier + +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected + +Unconnected output port 'LOCKED' of component 'dcm_sp_sfs' +Unconnected output port 'RL_MONI' of component 'rlink_base_serport' +Unconnected output port 'RL_SER_MONI' of component 'rlink_base_serport' +Unconnected output port 'ACK_W' of component 'n2_cram_memctl_as' +Unconnected output port 'OFIFO_SIZE' of component 'rlink_base' +Unconnected output port 'DOA' of component 'ram_1swar_1ar_gen' +Unconnected output port 'DOB' of component 'ram_2swsr_rfirst_gen' + +Input is never used +Input is never used +Input is never used +Input is never used +Input > is never used +Input > is never used +Input is never used +Input is never used +Input is never used +Input is never used +Input is never used +Input is never used +Input > is never used +Input > is never used +Input is never used +Input > is never used +Input is never used +Input is never used +Input > is never used +Input is never used +Input is never used +Input > is never used +Input is never used +Input is never used +Input is never used +Input > is never used + +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used + +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used + +Signal is assigned but never used +Signal is assigned but never used + +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal > is assigned but never used + +Signal > is assigned but never used +Signal > is assigned but never used +Signal is assigned but never used + +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent + +FF/Latch has a constant value of 0 +FF/Latch has a constant value of 0 +FF/Latch has a constant value +FF/Latch has a constant value of 0 +FF/Latch has a constant value of 0 +FF/Latch has a constant value of 0 + +# +# ---------------------------------------------------------------------------- +[tra] +INFO:.*TNM.*used in period specification.*was traced into DCM_SP + +# +# ---------------------------------------------------------------------------- +[map] +The signal is incomplete +Logical network I_MEM_WAIT_IBUF has no load +There is a dangling output parity pin +INFO:.* + +# +# ---------------------------------------------------------------------------- +[par] +The signal I_MEM_WAIT_IBUF has no load +There are 1 loadless signals in this design +# +# ---------------------------------------------------------------------------- +[bgn] +Spartan-3 1200E and 1600E devices do not support bitstream +The signal is incomplete +There is a dangling output parity pin +INFO:.*To achieve optimal frequency synthesis performance \ No newline at end of file diff --git a/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vbom b/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vbom index 64cc6327..9a4f8c1f 100644 --- a/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vbom +++ b/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vbom @@ -4,7 +4,7 @@ ../../../vlib/genlib/genlib.vhd ../../../vlib/rbus/rblib.vhd ../../../vlib/rlink/rlinklib.vbom -../../../bplib/s3board/s3boardlib.vbom +../../../bplib/bpgen/bpgenlib.vbom ../../../bplib/nexys2/nexys2lib.vhd ../../../ibus/iblib.vhd ../../../ibus/ibdlib.vhd @@ -14,8 +14,8 @@ sys_conf = sys_conf.vhd [xst,isim]../../../vlib/xlib/dcm_sp_sfs_unisim.vbom [ghdl]../../../vlib/xlib/dcm_sp_sfs_gsim.vbom ../../../vlib/genlib/clkdivce.vbom -../../../bplib/s3board/s3_rs232_iob_int_ext.vbom -../../../bplib/s3board/s3_humanio_rbus.vbom +../../../bplib/bpgen/bp_rs232_2l4l_iob.vbom +../../../bplib/bpgen/sn_humanio_rbus.vbom ../../../vlib/rlink/rlink_base_serport.vbom ../../../vlib/rbus/rb_sres_or_3.vbom ../../../w11a/pdp11_core_rbus.vbom diff --git a/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vhd b/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vhd index 90d0449d..82967ec1 100644 --- a/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vhd +++ b/rtl/sys_gen/w11a/nexys2/sys_w11a_n2.vhd @@ -1,6 +1,6 @@ --- $Id: sys_w11a_n2.vhd 351 2010-12-30 21:50:54Z mueller $ +-- $Id: sys_w11a_n2.vhd 404 2011-08-07 22:00:25Z mueller $ -- --- Copyright 2010- by Walter F.J. Mueller +-- Copyright 2010-2011 by Walter F.J. Mueller -- -- 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 @@ -17,8 +17,8 @@ -- -- Dependencies: vlib/xlib/dcm_sp_sfs -- vlib/genlib/clkdivce --- bplib/s3board/s3_rs232_iob_int_ext --- bplib/s3board/s3_humanio_rbus +-- bplib/bpgen/bp_rs232_2l4l_iob +-- bplib/bpgen/sn_humanio_rbus -- vlib/rlink/rlink_base_serport -- vlib/rri/rb_sres_or_3 -- w11a/pdp11_core_rbus @@ -33,7 +33,7 @@ -- ibus/ibdr_maxisys -- w11a/pdp11_tmu_sb [sim only] -- --- Test bench: tb/tb_s3board_w11a_n2 +-- Test bench: tb/tb_sys_w11a_n2 -- -- Target Devices: generic -- Tool versions: xst 8.2, 9.1, 9.2, 10.1, 11.4, 12.1; ghdl 0.26-0.29 @@ -62,6 +62,8 @@ -- -- Revision History: -- Date Rev Version Comment +-- 2011-07-09 391 1.2.2 use now bp_rs232_2l4l_iob +-- 2011-07-08 390 1.2.1 use now sn_humanio -- 2010-12-30 351 1.2 ported to rbv3 -- 2010-11-27 341 1.1.8 add DCM; new sys_conf consts for mem and clkdiv -- 2010-11-13 338 1.1.7 add O_CLKSYS (for DCM derived system clock) @@ -116,7 +118,7 @@ use work.xlib.all; use work.genlib.all; use work.rblib.all; use work.rlinklib.all; -use work.s3boardlib.all; +use work.bpgenlib.all; use work.nexys2lib.all; use work.iblib.all; use work.ibdlib.all; @@ -263,9 +265,10 @@ begin CE_MSEC => CE_MSEC ); - IOB_RS232 : s3_rs232_iob_int_ext + IOB_RS232 : bp_rs232_2l4l_iob port map ( CLK => CLK, + RESET => '0', SEL => SWI(0), RXD => RXD, TXD => TXD, @@ -279,7 +282,7 @@ begin O_RTS1_N => O_FUSP_RTS_N ); - HIO : s3_humanio_rbus + HIO : sn_humanio_rbus generic map ( DEBOUNCE => sys_conf_hio_debounce, RB_ADDR => rbaddr_hio) diff --git a/rtl/sys_gen/w11a/nexys2/tb/Makefile b/rtl/sys_gen/w11a/nexys2/tb/Makefile index 2655db1e..2336b4c4 100644 --- a/rtl/sys_gen/w11a/nexys2/tb/Makefile +++ b/rtl/sys_gen/w11a/nexys2/tb/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2010-05-26 295 1.0 Initial version # EXE_all = tb_w11a_n2 @@ -9,7 +10,7 @@ EXE_all = tb_w11a_n2 ISE_PATH = xc3s1200e-fg320-4 # # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -19,8 +20,8 @@ clean : ise_clean ghdl_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/sys_gen/w11a/s3board/Makefile b/rtl/sys_gen/w11a/s3board/Makefile index 60565927..37ea564b 100644 --- a/rtl/sys_gen/w11a/s3board/Makefile +++ b/rtl/sys_gen/w11a/s3board/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.2 use includes from rtl/make # 2010-05-28 295 1.1.4 rename sys_pdp11core -> sys_w11a_s3 # 2010-04-24 282 1.1.3 use %.impact rule, all=BIT_all now # 2009-11-20 251 1.1.2 add .mcs rule @@ -15,7 +16,7 @@ BIT_all = $(VBOM_all:.vbom=.bit) ISE_BOARD = s3board ISE_PATH = xc3s1000-ft256-4 # -.phony : all clean +.PHONY : all clean # all : $(BIT_all) # @@ -29,8 +30,8 @@ sys_w11a_s3.mcs : sys_w11a_s3.bit # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow -include $(RETROBASE)/rtl/vlib/Makefile.ghdl +include $(RETROBASE)/rtl/make/generic_xflow.mk +include $(RETROBASE)/rtl/make/generic_ghdl.mk # include $(VBOM_all:.vbom=.dep_xst) include $(VBOM_all:.vbom=.dep_ghdl) diff --git a/rtl/sys_gen/w11a/s3board/sys_w11a_s3.mfset b/rtl/sys_gen/w11a/s3board/sys_w11a_s3.mfset new file mode 100644 index 00000000..45279945 --- /dev/null +++ b/rtl/sys_gen/w11a/s3board/sys_w11a_s3.mfset @@ -0,0 +1,133 @@ +# $Id: sys_w11a_s3.mfset 406 2011-08-14 21:06:44Z mueller $ +# +# ---------------------------------------------------------------------------- +[xst] +INFO:.*Mux is complete : default of case is discarded + +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected +Node of sequential type is unconnected + +Unconnected output port 'RL_MONI' of component 'rlink_base_serport' +Unconnected output port 'RL_SER_MONI' of component 'rlink_base_serport' +Unconnected output port 'OFIFO_SIZE' of component 'rlink_base' +Unconnected output port 'DOA' of component 'ram_1swar_1ar_gen' +Unconnected output port 'DOB' of component 'ram_2swsr_rfirst_gen' +Unconnected output port 'ACK_W' of component 's3_sram_memctl' +Unconnected output port 'ACT_R' of component 's3_sram_memctl' +Unconnected output port 'ACT_W' of component 's3_sram_memctl' + +Input is never used +Input is never used +Input is never used +Input is never used +Input > is never used +Input > is never used +Input is never used +Input is never used +Input is never used +Input is never used +Input is never used +Input is never used +Input > is never used +Input > is never used +Input is never used +Input > is never used +Input is never used +Input is never used +Input > is never used +Input > is never used +Input is never used +Input is never used +Input is never used +Input > is never used + +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used + +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used + +Signal is assigned but never used +Signal is assigned but never used + +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal is assigned but never used +Signal > is assigned but never used + +Signal > is assigned but never used +Signal > is assigned but never used + +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent +FF/Latch in Unit is equivalent + +FF/Latch has a constant value of 0 +FF/Latch has a constant value +FF/Latch has a constant value of 0 +FF/Latch has a constant value of 0 + +# +# ---------------------------------------------------------------------------- +[tra] + +# +# ---------------------------------------------------------------------------- +[map] +There is a dangling output parity pin +INFO:.* + +# +# ---------------------------------------------------------------------------- +[par] + +# +# ---------------------------------------------------------------------------- +[bgn] +There is a dangling output parity pin diff --git a/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vbom b/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vbom index 96c7cdb8..ca6c2347 100644 --- a/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vbom +++ b/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vbom @@ -3,6 +3,7 @@ ../../../vlib/genlib/genlib.vhd ../../../vlib/rbus/rblib.vhd ../../../vlib/rlink/rlinklib.vbom +../../../bplib/bpgen/bpgenlib.vbom ../../../bplib/s3board/s3boardlib.vbom ../../../ibus/iblib.vhd ../../../ibus/ibdlib.vhd @@ -10,8 +11,8 @@ sys_conf = sys_conf.vhd # components ../../../vlib/genlib/clkdivce.vbom -../../../bplib/s3board/s3_rs232_iob_int_ext.vbom -../../../bplib/s3board/s3_humanio.vbom +../../../bplib/bpgen/bp_rs232_2l4l_iob.vbom +../../../bplib/bpgen/sn_humanio.vbom ../../../vlib/rlink/rlink_base_serport.vbom ../../../vlib/rbus/rb_sres_or_2.vbom ../../../w11a/pdp11_core_rbus.vbom diff --git a/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vhd b/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vhd index 7cf3711d..4fa069bb 100644 --- a/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vhd +++ b/rtl/sys_gen/w11a/s3board/sys_w11a_s3.vhd @@ -1,6 +1,6 @@ --- $Id: sys_w11a_s3.vhd 351 2010-12-30 21:50:54Z mueller $ +-- $Id: sys_w11a_s3.vhd 404 2011-08-07 22:00:25Z mueller $ -- --- Copyright 2007-2010 by Walter F.J. Mueller +-- Copyright 2007-2011 by Walter F.J. Mueller -- -- 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 @@ -16,8 +16,8 @@ -- Description: w11a test design for s3board -- -- Dependencies: vlib/genlib/clkdivce --- bplib/s3board/s3_rs232_iob_int_ext --- bplib/s3board/s3_humanio +-- bplib/bpgen/bp_rs232_2l4l_iob +-- bplib/bpgen/sn_humanio -- vlib/rlink/rlink_base_serport -- vlib/rbus/rb_sres_or_2 -- w11a/pdp11_core_rbus @@ -32,7 +32,7 @@ -- ibus/ibdr_maxisys -- w11a/pdp11_tmu_sb [sim only] -- --- Test bench: tb/tb_s3board_w11a_s3 +-- Test bench: tb/tb_sys_w11a_s3 -- -- Target Devices: generic -- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 10.1, 11.4, 12.1; ghdl 0.18-0.29 @@ -71,6 +71,8 @@ -- -- Revision History: -- Date Rev Version Comment +-- 2011-07-09 391 1.4.2 use now bp_rs232_2l4l_iob +-- 2011-07-08 390 1.4.1 use now sn_humanio -- 2010-12-30 351 1.4 ported to rbv3 -- 2010-11-06 336 1.3.7 rename input pin CLK -> I_CLK50 -- 2010-10-23 335 1.3.3 rename RRI_LAM->RB_LAM; @@ -133,6 +135,7 @@ use work.slvtypes.all; use work.genlib.all; use work.rblib.all; use work.rlinklib.all; +use work.bpgenlib.all; use work.s3boardlib.all; use work.iblib.all; use work.ibdlib.all; @@ -253,9 +256,10 @@ begin CE_MSEC => CE_MSEC ); - IOB_RS232 : s3_rs232_iob_int_ext + IOB_RS232 : bp_rs232_2l4l_iob port map ( CLK => CLK, + RESET => '0', SEL => SWI(0), RXD => RXD, TXD => TXD, @@ -269,7 +273,7 @@ begin O_RTS1_N => O_FUSP_RTS_N ); - HIO : s3_humanio + HIO : sn_humanio generic map ( DEBOUNCE => sys_conf_hio_debounce) port map ( diff --git a/rtl/sys_gen/w11a/s3board/tb/Makefile b/rtl/sys_gen/w11a/s3board/tb/Makefile index 5ed30ff2..1f45854a 100644 --- a/rtl/sys_gen/w11a/s3board/tb/Makefile +++ b/rtl/sys_gen/w11a/s3board/tb/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.3 use includes from rtl/make # 2010-05-26 295 1.2 rename tb_s3board_pdp11core -> tb_w11a_s3 # 2007-11-26 98 1.1 add all_ssim and all_tsim targets # 2007-09-23 84 1.0 Initial version @@ -11,7 +12,7 @@ EXE_all = tb_w11a_s3 ISE_PATH = xc3s1000-ft256-4 # # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -21,8 +22,8 @@ clean : ise_clean ghdl_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/vlib/comlib/Makefile b/rtl/vlib/comlib/Makefile index ea3c32f9..df93ae92 100644 --- a/rtl/vlib/comlib/Makefile +++ b/rtl/vlib/comlib/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.2 use includes from rtl/make # 2007-07-06 64 1.1 use Makefile.xflow # 2007-06-03 45 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -16,7 +17,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/comlib/comlib.vhd b/rtl/vlib/comlib/comlib.vhd index 24057f52..5aeca1f0 100644 --- a/rtl/vlib/comlib/comlib.vhd +++ b/rtl/vlib/comlib/comlib.vhd @@ -1,6 +1,6 @@ --- $Id: comlib.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: comlib.vhd 400 2011-07-31 09:02:16Z mueller $ -- --- Copyright 2007- by Walter F.J. Mueller +-- Copyright 2007-2011 by Walter F.J. Mueller -- -- 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 @@ -16,9 +16,10 @@ -- Description: communication components -- -- Dependencies: - --- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4; ghdl 0.18-0.26 +-- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4, 12.1; ghdl 0.18-0.29 -- Revision History: -- Date Rev Version Comment +-- 2011-07-30 400 1.3 added byte2word, word2byte -- 2007-10-12 88 1.2.1 avoid ieee.std_logic_unsigned, use cast to unsigned -- 2007-07-08 65 1.2 added procedure crc8_update_tbl -- 2007-06-29 61 1.1.1 rename for crc8 SALT->INIT @@ -34,6 +35,34 @@ use work.slvtypes.all; package comlib is +component byte2word is -- 2 byte -> 1 word stream converter + port ( + CLK : in slbit; -- clock + RESET : in slbit; -- reset + DI : in slv8; -- input data (byte) + ENA : in slbit; -- write enable + BUSY : out slbit; -- write port hold + DO : out slv16; -- output data (word) + VAL : out slbit; -- read valid + HOLD : in slbit; -- read hold + ODD : out slbit -- odd byte pending + ); +end component; + +component word2byte is -- 1 word -> 2 byte stream converter + port ( + CLK : in slbit; -- clock + RESET : in slbit; -- reset + DI : in slv16; -- input data (word) + ENA : in slbit; -- write enable + BUSY : out slbit; -- write port hold + DO : out slv8; -- output data (byte) + VAL : out slbit; -- read valid + HOLD : in slbit; -- read hold + ODD : out slbit -- odd byte pending + ); +end component; + component cdata2byte is -- 9bit comma,data -> byte stream generic ( CPREF : slv4 := "1000"; -- comma prefix @@ -83,7 +112,7 @@ end component; procedure crc8_update_tbl (crc : inout slv8; data : in slv8); -end comlib; +end package comlib; -- ---------------------------------------------------------------------------- diff --git a/rtl/vlib/comlib/crc8.vhd b/rtl/vlib/comlib/crc8.vhd index a3b70917..0d96438c 100644 --- a/rtl/vlib/comlib/crc8.vhd +++ b/rtl/vlib/comlib/crc8.vhd @@ -1,6 +1,6 @@ --- $Id: crc8.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: crc8.vhd 406 2011-08-14 21:06:44Z mueller $ -- --- Copyright 2007- by Walter F.J. Mueller +-- Copyright 2007-2011 by Walter F.J. Mueller -- -- 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 @@ -31,9 +31,10 @@ -- Dependencies: - -- Test bench: - -- Target Devices: generic --- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25 +-- Tool versions: xst 8.1, 8.2, 9.1, 9.2,.., 13.1; ghdl 0.18-0.25 -- Revision History: -- Date Rev Version Comment +-- 2011-08-14 406 1.0.1 remove superfluous variable r -- 2007-07-08 65 1.0 Initial version ------------------------------------------------------------------------------ @@ -78,13 +79,9 @@ begin end process proc_regs; proc_next: process (R_CRC, DI, ENA) - - variable r : slv8 := INIT; variable n : slv8 := INIT; - begin - r := R_CRC; n := R_CRC; if ENA = '1' then diff --git a/rtl/vlib/comlib/misc/Makefile b/rtl/vlib/comlib/misc/Makefile index 5c966c87..345eff06 100644 --- a/rtl/vlib/comlib/misc/Makefile +++ b/rtl/vlib/comlib/misc/Makefile @@ -1,13 +1,14 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-11-26 98 1.0 Initial version # EXE_all = gen_crc8_tbl gen_crc8_tbl_check # # -.phony : all clean +.PHONY : all clean # all : $(EXE_all) # @@ -15,7 +16,7 @@ clean : ghdl_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl +include $(RETROBASE)/rtl/make/generic_ghdl.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/vlib/genlib/Makefile b/rtl/vlib/genlib/Makefile index 2abd59df..ae164457 100644 --- a/rtl/vlib/genlib/Makefile +++ b/rtl/vlib/genlib/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.2 use includes from rtl/make # 2007-12-09 100 1.1.1 drop ISE_p definition # 2007-06-03 47 1.1 use Makefile.xflow # 2007-06-03 45 1.0 Initial version @@ -9,7 +10,7 @@ VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -17,7 +18,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/genlib/genlib.vhd b/rtl/vlib/genlib/genlib.vhd index 975e18ad..7526c01f 100644 --- a/rtl/vlib/genlib/genlib.vhd +++ b/rtl/vlib/genlib/genlib.vhd @@ -1,4 +1,4 @@ --- $Id: genlib.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: genlib.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2007-2010 by Walter F.J. Mueller -- @@ -153,4 +153,4 @@ component timer is -- retriggerable timer ); end component; -end genlib; +end package genlib; diff --git a/rtl/vlib/memlib/Makefile b/rtl/vlib/memlib/Makefile index 76292ba0..b11b5278 100644 --- a/rtl/vlib/memlib/Makefile +++ b/rtl/vlib/memlib/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-09 100 1.0.1 drop ISE_p definition # 2007-06-03 45 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -16,7 +17,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/memlib/memlib.vhd b/rtl/vlib/memlib/memlib.vhd index 5af9e5ac..2a7bdb9c 100644 --- a/rtl/vlib/memlib/memlib.vhd +++ b/rtl/vlib/memlib/memlib.vhd @@ -1,4 +1,4 @@ --- $Id: memlib.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: memlib.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2006-2007 by Walter F.J. Mueller -- @@ -235,4 +235,4 @@ component fifo_2c_dram is -- fifo, 2 clock, dram based ); end component; -end memlib; +end package memlib; diff --git a/rtl/vlib/memlib/ram_1swsr_xfirst_gen_unisim.vhd b/rtl/vlib/memlib/ram_1swsr_xfirst_gen_unisim.vhd index c23d7055..d43a6549 100644 --- a/rtl/vlib/memlib/ram_1swsr_xfirst_gen_unisim.vhd +++ b/rtl/vlib/memlib/ram_1swsr_xfirst_gen_unisim.vhd @@ -1,6 +1,6 @@ --- $Id: ram_1swsr_xfirst_gen_unisim.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: ram_1swsr_xfirst_gen_unisim.vhd 406 2011-08-14 21:06:44Z mueller $ -- --- Copyright 2008- by Walter F.J. Mueller +-- Copyright 2008-2011 by Walter F.J. Mueller -- -- 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 @@ -19,9 +19,10 @@ -- Dependencies: - -- Test bench: - -- Target Devices: Spartan-3, Virtex-2,-4 --- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25 +-- Tool versions: xst 8.1, 8.2, 9.1, 9.2,.., 13.1; ghdl 0.18-0.25 -- Revision History: -- Date Rev Version Comment +-- 2011-08-14 406 1.0.2 cleaner code for L_DI initialization -- 2008-04-13 135 1.0.1 fix range error for AW_14_S1 -- 2008-03-08 123 1.0 Initial version ------------------------------------------------------------------------------ @@ -71,6 +72,9 @@ begin signal L_DI : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DI(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DI(DI'range) <= DI; GL: for i in dw_mem/36-1 downto 0 generate @@ -122,7 +126,10 @@ begin signal L_DO : slv(dw_mem-1 downto 0) := (others=> '0'); signal L_DI : slv(dw_mem-1 downto 0) := (others=> '0'); begin - + + DI_PAD: if dw_mem>DWIDTH generate + L_DI(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DI(DI'range) <= DI; GL: for i in dw_mem/18-1 downto 0 generate @@ -175,6 +182,9 @@ begin signal L_DI : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DI(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DI(DI'range) <= DI; GL: for i in dw_mem/9-1 downto 0 generate @@ -227,6 +237,9 @@ begin signal L_DI : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DI(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DI(DI'range) <= DI; GL: for i in dw_mem/4-1 downto 0 generate @@ -256,6 +269,9 @@ begin signal L_DI : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DI(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DI(DI'range) <= DI; GL: for i in dw_mem/2-1 downto 0 generate diff --git a/rtl/vlib/memlib/ram_2swsr_xfirst_gen_unisim.vhd b/rtl/vlib/memlib/ram_2swsr_xfirst_gen_unisim.vhd index c341b606..a522b635 100644 --- a/rtl/vlib/memlib/ram_2swsr_xfirst_gen_unisim.vhd +++ b/rtl/vlib/memlib/ram_2swsr_xfirst_gen_unisim.vhd @@ -1,6 +1,6 @@ --- $Id: ram_2swsr_xfirst_gen_unisim.vhd 314 2010-07-09 17:38:41Z mueller $ +-- $Id: ram_2swsr_xfirst_gen_unisim.vhd 406 2011-08-14 21:06:44Z mueller $ -- --- Copyright 2008- by Walter F.J. Mueller +-- Copyright 2008-2011 by Walter F.J. Mueller -- -- 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 @@ -19,9 +19,10 @@ -- Dependencies: - -- Test bench: - -- Target Devices: Spartan-3, Virtex-2,-4 --- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25 +-- Tool versions: xst 8.1, 8.2, 9.1, 9.2,.., 13.1; ghdl 0.18-0.25 -- Revision History: -- Date Rev Version Comment +-- 2011-08-14 406 1.0.2 cleaner code for L_DI(A|B) initialization -- 2008-04-13 135 1.0.1 fix range error for AW_14_S1 -- 2008-03-08 123 1.0 Initial version (merged from _rfirst/_wfirst) ------------------------------------------------------------------------------ @@ -79,6 +80,10 @@ begin signal L_DIB : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DIA(dw_mem-1 downto DWIDTH) <= (others=>'0'); + L_DIB(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DIA(DIA'range) <= DIA; L_DIB(DIB'range) <= DIB; @@ -159,6 +164,10 @@ begin signal L_DIB : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DIA(dw_mem-1 downto DWIDTH) <= (others=>'0'); + L_DIB(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DIA(DIA'range) <= DIA; L_DIB(DIB'range) <= DIB; @@ -239,6 +248,10 @@ begin signal L_DIB : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DIA(dw_mem-1 downto DWIDTH) <= (others=>'0'); + L_DIB(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DIA(DIA'range) <= DIA; L_DIB(DIB'range) <= DIB; @@ -319,6 +332,10 @@ begin signal L_DIB : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DIA(dw_mem-1 downto DWIDTH) <= (others=>'0'); + L_DIB(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DIA(DIA'range) <= DIA; L_DIB(DIB'range) <= DIB; @@ -362,6 +379,10 @@ begin signal L_DIB : slv(dw_mem-1 downto 0) := (others=> '0'); begin + DI_PAD: if dw_mem>DWIDTH generate + L_DIA(dw_mem-1 downto DWIDTH) <= (others=>'0'); + L_DIB(dw_mem-1 downto DWIDTH) <= (others=>'0'); + end generate DI_PAD; L_DIA(DIA'range) <= DIA; L_DIB(DIB'range) <= DIB; diff --git a/rtl/vlib/rbus/Makefile b/rtl/vlib/rbus/Makefile index fed95661..7221555b 100644 --- a/rtl/vlib/rbus/Makefile +++ b/rtl/vlib/rbus/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 343 2010-12-05 21:24:38Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-09 100 1.0.1 drop ISE_p definition # 2007-07-06 64 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -16,7 +17,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/rbus/rbd_eyemon.vhd b/rtl/vlib/rbus/rbd_eyemon.vhd index 0ec98305..0c639c18 100644 --- a/rtl/vlib/rbus/rbd_eyemon.vhd +++ b/rtl/vlib/rbus/rbd_eyemon.vhd @@ -1,4 +1,4 @@ --- $Id: rbd_eyemon.vhd 375 2011-04-02 07:56:47Z mueller $ +-- $Id: rbd_eyemon.vhd 406 2011-08-14 21:06:44Z mueller $ -- -- Copyright 2010-2011 by Walter F.J. Mueller -- @@ -137,6 +137,8 @@ architecture syn of rbd_eyemon is begin + BRAM_DIA <= (others=>'0'); -- always 0, no writes on this port + BRAM : ram_2swsr_wfirst_gen generic map ( AWIDTH => 9, diff --git a/rtl/vlib/rbus/rbd_rbmon.vhd b/rtl/vlib/rbus/rbd_rbmon.vhd index a2ad3613..6e9b0623 100644 --- a/rtl/vlib/rbus/rbd_rbmon.vhd +++ b/rtl/vlib/rbus/rbd_rbmon.vhd @@ -1,4 +1,4 @@ --- $Id: rbd_rbmon.vhd 374 2011-03-27 17:02:47Z mueller $ +-- $Id: rbd_rbmon.vhd 387 2011-07-03 17:24:52Z mueller $ -- -- Copyright 2010-2011 by Walter F.J. Mueller -- @@ -33,17 +33,17 @@ -- 2010-12-27 349 1.0 Initial version ------------------------------------------------------------------------------ -- --- address layout: --- bbbbbb00 : cntl --- 00 : go/halt (writing 1 clears addr) --- bbbbbb01 : alim: read-write register --- 15:08 : hilim: upper address limit (def: ff) --- 7:00 : lolim: lower address limit (def: 00) --- bbbbbb10 : addr: read-write register --- 15 : wrap: line address wrapped (read-only, cleared on write) --- xx:02 : laddr: line address --- 01:00 : waddr: word address --- bbbbbb11 : data: read-write register +-- Address Bits Name r/w/f Function +-- bbbbbb00 cntl r/w/f Control register +-- 00 go r/w/f writing 1 clears add +-- bbbbbb01 alim r/w/- Address limit register +-- 15:08 hilim r/w/- upper address limit (def: ff) +-- 07:00 lolim r/w/- lower address limit (def: 00) +-- bbbbbb10 addr r/w/- Address register +-- 15 wrap r/0/- line address wrapped (cleared on write) +-- *:02 laddr r/w/- line address +-- 01:00 waddr r/w/- word address +-- bbbbbb11 data r/w/- Data register -- -- data format: -- word 3 15 : ack diff --git a/rtl/vlib/rbus/rblib.vhd b/rtl/vlib/rbus/rblib.vhd index a8faf80c..8c17f5c7 100644 --- a/rtl/vlib/rbus/rblib.vhd +++ b/rtl/vlib/rbus/rblib.vhd @@ -1,6 +1,6 @@ --- $Id: rblib.vhd 349 2010-12-28 14:02:13Z mueller $ +-- $Id: rblib.vhd 405 2011-08-14 08:16:28Z mueller $ -- --- Copyright 2007-2010 by Walter F.J. Mueller +-- Copyright 2007-2011 by Walter F.J. Mueller -- -- 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 @@ -20,6 +20,7 @@ -- -- Revision History: -- Date Rev Version Comment +-- 2011-08-13 405 3.0.3 add in direction for FADDR,SEL ports -- 2010-12-26 349 3.0.2 add rb_sel -- 2010-12-22 346 3.0.1 add rb_mon and rb_mon_sb; -- 2010-12-04 343 3.0 extracted from rrilib and rritblib; @@ -113,8 +114,8 @@ component rb_wreg_rw_3 is -- rbus: wide register r/w 3 bit select port ( CLK : in slbit; -- clock RESET : in slbit; -- reset - FADDR : slv3; -- field address - SEL : slbit; -- select + FADDR : in slv3; -- field address + SEL : in slbit; -- select DATA : out slv(DWIDTH-1 downto 0); -- data RB_MREQ : in rb_mreq_type; -- rbus request RB_SRES : out rb_sres_type -- rbus response @@ -127,8 +128,8 @@ component rb_wreg_w_3 is -- rbus: wide register w-o 3 bit select port ( CLK : in slbit; -- clock RESET : in slbit; -- reset - FADDR : slv3; -- field address - SEL : slbit; -- select + FADDR : in slv3; -- field address + SEL : in slbit; -- select DATA : out slv(DWIDTH-1 downto 0); -- data RB_MREQ : in rb_mreq_type; -- rbus request RB_SRES : out rb_sres_type -- rbus response @@ -139,8 +140,8 @@ component rb_wreg_r_3 is -- rbus: wide register r-o 3 bit select generic ( DWIDTH : positive := 16); port ( - FADDR : slv3; -- field address - SEL : slbit; -- select + FADDR : in slv3; -- field address + SEL : in slbit; -- select DATA : in slv(DWIDTH-1 downto 0); -- data RB_SRES : out rb_sres_type -- rbus response ); @@ -189,5 +190,4 @@ component rb_mon_sb is -- simbus wrapper for rbus monitor ); end component; - -end rblib; +end package rblib; diff --git a/rtl/vlib/rlink/Makefile b/rtl/vlib/rlink/Makefile index fed95661..7221555b 100644 --- a/rtl/vlib/rlink/Makefile +++ b/rtl/vlib/rlink/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 343 2010-12-05 21:24:38Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-09 100 1.0.1 drop ISE_p definition # 2007-07-06 64 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -16,7 +17,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/rlink/rlink_serport.vhd b/rtl/vlib/rlink/rlink_serport.vhd index c3edccf3..a7a99bdc 100644 --- a/rtl/vlib/rlink/rlink_serport.vhd +++ b/rtl/vlib/rlink/rlink_serport.vhd @@ -1,6 +1,6 @@ --- $Id: rlink_serport.vhd 350 2010-12-28 16:40:11Z mueller $ +-- $Id: rlink_serport.vhd 406 2011-08-14 21:06:44Z mueller $ -- --- Copyright 2007-2010 by Walter F.J. Mueller +-- Copyright 2007-2011 by Walter F.J. Mueller -- -- 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 @@ -20,7 +20,7 @@ -- Test bench: tb/tb_rlink_serport -- -- Target Devices: generic --- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4, 12.1; ghdl 0.18-0.29 +-- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 11.4, 12.1, 13.1; ghdl 0.18-0.29 -- -- Synthesized (xst): -- Date Rev ise Target flop lutl lutm slic t peri @@ -28,6 +28,7 @@ -- -- Revision History: -- Date Rev Version Comment +-- 2011-08-14 406 3.1.1 cleaner code for RL_SER_MONI.clkdiv assignment -- 2010-12-25 348 3.1 re-written, is now a serial to rlink_base adapter -- 2010-12-24 347 3.0.1 rename: CP_*->RL->* -- 2010-12-04 343 3.0 renamed rri_ -> rlink_ @@ -110,7 +111,7 @@ architecture syn of rlink_serport is signal TXBUSY : slbit := '0'; signal ABACT : slbit := '0'; signal ABDONE : slbit := '0'; - signal ABCLKDIV : slv16 := (others=>'0'); + signal ABCLKDIV : slv(CDWIDTH-1 downto 0) := (others=>'0'); begin @@ -230,6 +231,11 @@ begin RL_SER_MONI.txact <= TXBUSY; RL_SER_MONI.abact <= ABACT; RL_SER_MONI.abdone <= ABDONE; - RL_SER_MONI.clkdiv <= ABCLKDIV; + + proc_clkdiv: process (ABCLKDIV) + begin + RL_SER_MONI.clkdiv <= (others=>'0'); + RL_SER_MONI.clkdiv(ABCLKDIV'range) <= ABCLKDIV; + end process proc_clkdiv; end syn; diff --git a/rtl/vlib/rlink/rlinklib.vhd b/rtl/vlib/rlink/rlinklib.vhd index af52a792..ad52a806 100644 --- a/rtl/vlib/rlink/rlinklib.vhd +++ b/rtl/vlib/rlink/rlinklib.vhd @@ -1,4 +1,4 @@ --- $Id: rlinklib.vhd 348 2010-12-26 15:23:44Z mueller $ +-- $Id: rlinklib.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2007-2010 by Walter F.J. Mueller -- @@ -305,4 +305,4 @@ component rlink_mon_sb is -- simbus wrap for rlink monitor ); end component; -end rlinklib; +end package rlinklib; diff --git a/rtl/vlib/rlink/tb/Makefile b/rtl/vlib/rlink/tb/Makefile index 13671146..53dd7003 100644 --- a/rtl/vlib/rlink/tb/Makefile +++ b/rtl/vlib/rlink/tb/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 349 2010-12-28 14:02:13Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.4 use includes from rtl/make # 2010-12-28 349 1.3.1 add tb_rlink_tba_eyemon # 2010-12-05 343 1.3 rri->rlink renames # 2009-11-21 252 1.2 add ISim support @@ -14,7 +15,7 @@ EXE_all = tb_rlink_direct tb_rlink_serport \ tb_rlink_tba_ttcombo tb_rlink_tba_eyemon # # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -24,9 +25,9 @@ clean : ise_clean ghdl_clean isim_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.isim -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_isim.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/vlib/rlink/tb/rlink_cext_vhpi.vhd b/rtl/vlib/rlink/tb/rlink_cext_vhpi.vhd index d687544b..d54ea6fe 100644 --- a/rtl/vlib/rlink/tb/rlink_cext_vhpi.vhd +++ b/rtl/vlib/rlink/tb/rlink_cext_vhpi.vhd @@ -1,4 +1,4 @@ --- $Id: rlink_cext_vhpi.vhd 351 2010-12-30 21:50:54Z mueller $ +-- $Id: rlink_cext_vhpi.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2007-2010 by Walter F.J. Mueller -- @@ -37,7 +37,7 @@ package rlink_cext_vhpi is attribute foreign of rlink_cext_putbyte : function is "VHPIDIRECT rlink_cext_putbyte"; -end rlink_cext_vhpi; +end package rlink_cext_vhpi; package body rlink_cext_vhpi is @@ -55,4 +55,4 @@ package body rlink_cext_vhpi is report "rlink_cext_getbyte not vhpi'ed" severity failure; end rlink_cext_putbyte; -end rlink_cext_vhpi; +end package body rlink_cext_vhpi; diff --git a/rtl/vlib/rlink/tb/rlinktblib.vhd b/rtl/vlib/rlink/tb/rlinktblib.vhd index b6b529ee..8427285f 100644 --- a/rtl/vlib/rlink/tb/rlinktblib.vhd +++ b/rtl/vlib/rlink/tb/rlinktblib.vhd @@ -1,4 +1,4 @@ --- $Id: rlinktblib.vhd 351 2010-12-30 21:50:54Z mueller $ +-- $Id: rlinktblib.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2007-2010 by Walter F.J. Mueller -- @@ -174,4 +174,4 @@ component rricp_rp is -- rri comm->reg port aif forwarder ); end component; -end rlinktblib; +end package rlinktblib; diff --git a/rtl/vlib/serport/Makefile b/rtl/vlib/serport/Makefile index e394d08b..5086e35d 100644 --- a/rtl/vlib/serport/Makefile +++ b/rtl/vlib/serport/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-09 100 1.0.1 drop ISE_p definition # 2007-07-03 45 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -16,7 +17,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/serport/serport.vhd b/rtl/vlib/serport/serport.vhd index b063c53f..117597e6 100644 --- a/rtl/vlib/serport/serport.vhd +++ b/rtl/vlib/serport/serport.vhd @@ -1,4 +1,4 @@ --- $Id: serport.vhd 348 2010-12-26 15:23:44Z mueller $ +-- $Id: serport.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2007-2010 by Walter F.J. Mueller -- @@ -134,4 +134,4 @@ component serport_uart_autobaud is -- serial port uart: autobauder ); end component; -end serport; +end package serport; diff --git a/rtl/vlib/serport/tb/Makefile b/rtl/vlib/serport/tb/Makefile index aaa5107a..29fc82cc 100644 --- a/rtl/vlib/serport/tb/Makefile +++ b/rtl/vlib/serport/tb/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.3 use includes from rtl/make # 2009-11-21 252 1.2 add ISim support # 2007-11-26 98 1.1 use make includes # 2007-06-03 48 1.0 Initial version # EXE_all = tb_serport_uart_rx tb_serport_uart_rxtx tb_serport_autobaud # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -18,9 +19,9 @@ clean : ise_clean ghdl_clean isim_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.isim -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_isim.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/rtl/vlib/xlib/Makefile b/rtl/vlib/xlib/Makefile index ce5f37d0..3d76c997 100644 --- a/rtl/vlib/xlib/Makefile +++ b/rtl/vlib/xlib/Makefile @@ -1,13 +1,14 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version omment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-08 100 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -15,7 +16,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/vlib/xlib/xlib.vhd b/rtl/vlib/xlib/xlib.vhd index b1c06a8c..4bc85564 100644 --- a/rtl/vlib/xlib/xlib.vhd +++ b/rtl/vlib/xlib/xlib.vhd @@ -1,4 +1,4 @@ --- $Id: xlib.vhd 338 2010-11-13 22:19:25Z mueller $ +-- $Id: xlib.vhd 389 2011-07-07 21:59:00Z mueller $ -- -- Copyright 2007-2010 by Walter F.J. Mueller -- @@ -164,4 +164,4 @@ component dcm_sp_sfs is -- DCM_SP as 'simple freq. synthesis' ); end component; -end xlib; +end package xlib; diff --git a/rtl/vlib/xst_vhdl.opt b/rtl/vlib/xst_vhdl.opt deleted file mode 100644 index 9d2c67ac..00000000 --- a/rtl/vlib/xst_vhdl.opt +++ /dev/null @@ -1,63 +0,0 @@ -FLOWTYPE = FPGA_SYNTHESIS; -######################################################### -## Filename: xst_vhdl.opt -## -## VHDL Option File for XST targeted for speed -## This works for FPGA devices. -## -## Version: 8.1.1 -## $Header: /devl/xcs/repo/env/Jobs/Xflow/data/optionfiles/fpga_xst_vhdl_speed.opt,v 1.13 2004/10/01 22:29:20 rvklair Exp $ -######################################################### -# Options for XST -# -# -# -Program xst --ifn _xst.scr; # input XST script file --ofn _xst.log; # output XST log file --intstyle xflow; # Message Reporting Style: ise, xflow, or silent -# -# The options listed under ParamFile are the XST Properties that can be set by the -# user. To turn on an option, uncomment by removing the '#' in front of the switch. -# -ParamFile: _xst.scr -"run"; -# -# Global Synthesis Options -# -"-ifn "; # Input/Project File Name -"-ifmt VHDL"; # Input Format -"-ofn "; # Output File Name -"-ofmt ngc"; # Output File Format -"-p "; # Target Device -"-opt_mode SPEED"; # Optimization Criteria # AREA or SPEED -"-opt_level 2"; -"-uc .xcf"; # Constraint File name -#"-case maintain"; # Specifies how to handle source name case - # upper, lower -#"-keep_hierarchy NO"; # Prevents optimization across module boundaries - # CPLD default YES, FPGA default NO -#"-write_timing_constraints NO"; # Write Timing Constraints - # YES, NO -#"-cross_clock_analysis NO"; # Cross Clock Option - # YES, NO -#"-iobuf YES"; # Add I/O Buffers to top level portS - # YES, NO -# -# The following are HDL Options -# -# The following are Xilinx FPGA specific options for Virtex, VirtexE, Virtex-II and Spartan2 -# -#"-register_balancing NO"; # Register Balancing - # YES, NO, Forward, Backward -#"-move_first_stage YES"; # Move First Flip-Flop Stage - # YES, NO -#"-move_last_stage YES"; # Move Last Flip-Flop Stage - # YES, NO -End ParamFile -End Program xst -# -# See XST USER Guide Chapter 8 (Command Line Mode) for all XST options -# - - diff --git a/rtl/w11a/Makefile b/rtl/w11a/Makefile index a63ebe78..f88800e9 100644 --- a/rtl/w11a/Makefile +++ b/rtl/w11a/Makefile @@ -1,14 +1,15 @@ -# $Id: Makefile 311 2010-06-30 17:52:37Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.1 use includes from rtl/make # 2007-12-09 100 1.0.1 drop ISE_p def # 2007-07-08 65 1.0 Initial version # VBOM_all = $(wildcard *.vbom) NGC_all = $(VBOM_all:.vbom=.ngc) # -.phony : all clean +.PHONY : all clean # all : $(NGC_all) # @@ -16,7 +17,7 @@ clean : ise_clean # #---- # -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_xflow.mk # include $(VBOM_all:.vbom=.dep_xst) # diff --git a/rtl/w11a/tb/Makefile b/rtl/w11a/tb/Makefile index fbe83962..b3597b95 100644 --- a/rtl/w11a/tb/Makefile +++ b/rtl/w11a/tb/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 351 2010-12-30 21:50:54Z mueller $ +# $Id: Makefile 405 2011-08-14 08:16:28Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.4 use includes from rtl/make # 2010-12-30 351 1.3 retire tb_rripdp_pdp11core tb_rriext_pdp11core # 2009-11-22 252 1.2 add ISim support # 2007-09-16 83 1.1.1 add include *.o.dep_ghdl @@ -11,7 +12,7 @@ EXE_all = tb_pdp11core tb_rlink_tba_pdp11core # # -.phony : all all_ssim all_tsim clean +.PHONY : all all_ssim all_tsim clean # all : $(EXE_all) all_ssim : $(EXE_all:=_ssim) @@ -21,9 +22,9 @@ clean : ise_clean ghdl_clean isim_clean # #----- # -include $(RETROBASE)/rtl/vlib/Makefile.ghdl -include $(RETROBASE)/rtl/vlib/Makefile.isim -include $(RETROBASE)/rtl/vlib/Makefile.xflow +include $(RETROBASE)/rtl/make/generic_ghdl.mk +include $(RETROBASE)/rtl/make/generic_isim.mk +include $(RETROBASE)/rtl/make/generic_xflow.mk # VBOM_all = $(wildcard *.vbom) # diff --git a/tools/bin/.cvsignore b/tools/bin/.cvsignore new file mode 100644 index 00000000..2ecbac9d --- /dev/null +++ b/tools/bin/.cvsignore @@ -0,0 +1 @@ +cycfx2prog diff --git a/tools/bin/config_wrapper b/tools/bin/config_wrapper new file mode 100755 index 00000000..7a3b3fa9 --- /dev/null +++ b/tools/bin/config_wrapper @@ -0,0 +1,246 @@ +#!/usr/bin/perl -w +# $Id: config_wrapper 402 2011-08-05 18:56:44Z mueller $ +# +# Copyright 2010-2011 by Walter F.J. Mueller +# +# 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. +# +# Revision History: +# Date Rev Version Comment +# 2011-08-04 402 1.1.4 add atlys support; +# 2011-07-25 399 1.1.3 add nexys2-500 support; bsdl path for sp605 +# 2011-07-18 395 1.1.2 cleanup bsdl path creation for jtag +# 2011-07-17 394 1.1.1 add bit->svf conversion and config with jtag +# 2011-07-11 393 1.1 renamed from impact_wrapper; add function parameter, +# old action with 'iconfig' +# 2011-07-01 386 1.0.3 support sp605/xc6slx45t +# 2010-05-24 294 1.0.2 support nexys2/xc3s1200e +# 2010-04-24 282 1.0.1 proper error exit for GetOptions() +# 2010-04-24 281 1.0 Initial version +# + +use 5.005; # require Perl 5.005 or higher +use strict; # require strict checking +use FileHandle; + +use Getopt::Long; + +my %opts = (); + +GetOptions(\%opts, "help", "dry_run", "board=s", "path=s") or exit 1; + +# setup defaults for board and path +if (not defined $opts{board}) { + $opts{board} = "s3board"; +} +if (not defined $opts{path}) { + $opts{path} = "xc3s1000" if $opts{board} eq "s3board"; + $opts{path} = "xc3s1200e" if $opts{board} eq "nexys2"; + $opts{path} = "xc6slx45" if $opts{board} eq "atlys"; + $opts{path} = "xc6slx45t" if $opts{board} eq "sp605"; +} + +sub print_help; +sub run_command; + + +autoflush STDOUT 1 if (-p STDOUT); # autoflush if output into pipe + +if (exists $opts{help}) { + print_help; + exit 0; +} + +my $board = $opts{board}; +my $ipath = $opts{path}; + +$ipath =~ s/-.*$//; # trim all after first '-' + +# now setup JTAG chain config + +my @plist; +my $pfpga; + +# +# Note: when new targets are added update also the blist logic below +# +if ($board eq "s3board" && $ipath eq "xc3s200") { # S3BOARD-200 + @plist = ($ipath, "xcf02s"); + $pfpga = 1; +} elsif ($board eq "s3board" && $ipath eq "xc3s1000") { # S3BOARD-1200 + @plist = ($ipath, "xcf04s"); + $pfpga = 1; + +} elsif ($board eq "nexys2" && $ipath eq "xc3s1200e") { # nexys2-1200 + @plist = ($ipath, "xcf04s"); + $pfpga = 1; +} elsif ($board eq "nexys2" && $ipath eq "xc3s500e") { # nexys2-500 + @plist = ($ipath, "xcf04s"); + $pfpga = 1; + +} elsif ($board eq "atlys" && $ipath eq "xc6slx45") { # atlys + @plist = ($ipath); + $pfpga = 1; + +} elsif ($board eq "sp605" && $ipath eq "xc6slx45t") { # sp605 + @plist = ("xccace", $ipath); + $pfpga = 2; +} else { + print STDERR "config_wrapper-E: only s3board/nexys2/sp605 supported\n"; + exit 1; +} + +my @blist; +foreach my $part (@plist) { + if ($part =~ m/^xcf/) { push @blist, "xcf/data" } # proms + elsif ($part =~ m/^xc3s\d*$/) { push @blist, "spartan3/data" } # s-3 + elsif ($part =~ m/^xc3s\d*e$/) { push @blist, "spartan3e/data" } # s-3e + elsif ($part =~ m/^xc6slx\d*t?$/) { push @blist, "spartan6/data" }# s-6 lx + elsif ($part =~ m/^xccace$/) { push @blist, "acempm/data" } # sys-ace + else { + print STDERR "config_wrapper-E: no bsdl path known for $part\n"; + exit 1; + } +} + +my $cmd = shift @ARGV; +my $file = shift @ARGV; + +if (! defined $cmd) { + print STDERR "config_wrapper-E: no command specified\n"; + exit 1; +} + +if (! defined $file) { + print STDERR "config_wrapper-E: no bit or svf file specified\n"; + exit 1; +} +if (! -r $file) { + print STDERR "config_wrapper-E: input file not found or readable\n"; + exit 1; +} + +my $xilpath = $ENV{XILINX}; +if (! defined $xilpath) { + print STDERR "config_wrapper-E: XILINX environment variable not defined\n"; + exit 1; +} + +# ----- iconfig action -------------------------------------------------------- +if ($cmd eq "iconfig") { + + my $tmpfile = "tmp_config_wrapper.cmd"; + open (OFILE, ">$tmpfile") or die "Couldn't open tmp cmd file: $!"; + + print OFILE "setMode -bs\n"; + print OFILE "setCable -p auto\n"; + for (my $i = 0; $i<=$#plist; $i++) { + printf OFILE "addDevice -p %d -part %s\n", $i+1, $plist[$i]; + } + printf OFILE "assignFile -p %d -file %s\n", $pfpga, $file; + printf OFILE "program -p %d -verify\n", $pfpga; + print OFILE "quit\n"; + + close (OFILE) or die "Couldn't close tmp cmd file: $!"; + + my $rc = run_command("impact -batch", $tmpfile); + exit $rc; + +# ----- jconfig action -------------------------------------------------------- +} elsif ($cmd eq "jconfig") { + + my $bpath = join ";", map "$xilpath/$_",@blist; + + my $tmpfile = "tmp_config_wrapper.cmd"; + open (OFILE, ">$tmpfile") or die "Couldn't open tmp cmd file: $!"; + + # the UrJtag and Xilinx impact have different chain and part number schemes + # impact: 1-based, 1 is first in chain; + # UrJtag: 0-based, 0 is last in chain; + # e.g. on Digilent Nexys2: + # impact: (1) FPGA (2) PROM + # UrJtag: (1) FPGA (0) PROM + + my $jtag_part = $#plist + 1 - $pfpga; + + print OFILE "cable usbblaster\n"; + printf OFILE "bsdl path %s\n", $bpath; + print OFILE "detect\n"; + printf OFILE "part %d\n", $jtag_part; + printf OFILE "svf %s\n", $file; + + close (OFILE) or die "Couldn't close tmp cmd file: $!"; + + my $rc = run_command("jtag", $tmpfile); + exit $rc; + +# ----- bit2svf action -------------------------------------------------------- +} elsif ($cmd eq "bit2svf") { + my $ofile = $file; + $ofile =~ s/\.bit/\.svf/; + + my $tmpfile = "tmp_config_wrapper.cmd"; + open (OFILE, ">$tmpfile") or die "Couldn't open tmp cmd file: $!"; + + print OFILE "setMode -bs\n"; + printf OFILE "setCable -port svf -file %s\n", $ofile; + printf OFILE "addDevice -p 1 -file %s\n", $file; + print OFILE "program -p 1\n"; + print OFILE "quit\n"; + + close (OFILE) or die "Couldn't close tmp cmd file: $!"; + + my $rc = run_command("impact -batch", $tmpfile); + exit $rc; +} + +print STDERR "config_wrapper-E: command must be bit2svf, iconfig or jconfig\n"; +exit 1; + +#------------------------------------------------------------------------------- + +sub run_command { + + my ($cmd, $tmpfile) = @_; + + my $wrc; + if (defined $opts{dry_run}) { + print STDOUT "$cmd\n"; + $wrc = system "/bin/sh", "-c", "cat $tmpfile"; + } else { + $wrc = system "/bin/sh", "-c", "$cmd $tmpfile"; + } + + my $rc = 0; + if ($wrc != 0) { + my $rc = int($wrc/256); + if ($rc == 0) { + my $sig = $wrc % 256; + print STDERR "config_wrapper-I $cmd aborted by signal $sig\n"; + $rc = 1; + } else { + print STDERR "config_wrapper-I $cmd failed (rc=$rc) $?\n"; + } + } + + unlink $tmpfile or die "Couldn't delete tmp cmd file: $!"; + return $rc; +} + +#------------------------------------------------------------------------------- + +sub print_help { + print "usage: config_wrapper [--help] [--board=b] [--path=p] cmd file\n"; + print " cmd bit2svf or iconfig or jconfig\n"; + print " --help this message\n"; + print " --dry_run print impact command list\n"; + print " --board=b type of board\n"; + print " --path=p type of fpga\n"; +} diff --git a/tools/bin/impact_wrapper b/tools/bin/impact_wrapper deleted file mode 100755 index 3f9cad56..00000000 --- a/tools/bin/impact_wrapper +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/perl -w -# $Id: impact_wrapper 314 2010-07-09 17:38:41Z mueller $ -# -# Copyright 2010- by Walter F.J. Mueller -# -# 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. -# -# Revision History: -# Date Rev Version Comment -# 2010-05-24 294 1.0.2 support nexys2/xc3s1200e -# 2010-04-24 282 1.0.1 proper error exit for GetOptions() -# 2010-04-24 281 1.0 Initial version -# - -use 5.005; # require Perl 5.005 or higher -use strict; # require strict checking -use FileHandle; - -use Getopt::Long; - -my %opts = (); - -$opts{board} = "s3board"; -$opts{path} = "xc3s1000"; - -GetOptions(\%opts, "help", "board=s", "path=s") or exit 1; - -sub print_help; - -autoflush STDOUT 1 if (-p STDOUT); # autoflush if output into pipe - -if (exists $opts{help}) { - print_help; - exit 0; -} - -my $board = $opts{board}; -my $ipath = $opts{path}; - -$ipath =~ s/-.*$//; # trim all after first '-' - -# at this point just support Digilent s3board with xc3s200 or xc3s1000 - -my $part2; - -if ($board eq "s3board" && $ipath eq "xc3s200") { - $part2 = "xcf02s"; -} elsif ($board eq "s3board" && $ipath eq "xc3s1000") { - $part2 = "xcf04s"; -} elsif ($board eq "nexys2" && $ipath eq "xc3s1200e") { - $part2 = "xcf04s"; -} else { - print STDERR "impact_wrapper-E: only s3board/nexys2 supported\n"; - exit 1; -} - -my $file = shift @ARGV; - -if (! defined $file) { - print STDERR "impact_wrapper-E: no bit file specified\n"; - exit 1; -} -if (! -r $file) { - print STDERR "impact_wrapper-E: input file not found or readable\n"; - exit 1; -} - -my $tmpfile = "tmp_impact_wrapper.cmd"; - -open (OFILE, ">$tmpfile") or die "Couldn't open tmp cmd file: $!"; - -print OFILE "setMode -bs\n"; -print OFILE "setCable -p auto\n"; -print OFILE "addDevice -p 1 -part $ipath\n"; -print OFILE "addDevice -p 2 -part $part2\n"; -print OFILE "assignFile -p 1 -file $file\n"; -print OFILE "program -p 1 -verify\n"; -print OFILE "quit\n"; - -close (OFILE) or die "Couldn't close tmp cmd file: $!"; - -my $wrc = system "/bin/sh", "-c", "impact -batch $tmpfile"; -my $rc = 0; -if ($wrc != 0) { - my $rc = int($wrc/256); - if ($rc == 0) { - my $sig = $wrc % 256; - print STDERR "impact_wrapper-I impact aborted by signal $sig\n"; - $rc = 1; - } else { - print STDERR "impact_wrapper-I impact failed (rc=$rc) $?\n"; - } -} - -unlink $tmpfile or die "Couldn't delete tmp cmd file: $!"; - -exit $rc; - -#------------------------------------------------------------------------------- - -sub print_help { - print "usage: impact_wrapper [--help] [--board=b] [--path=p] file\n"; - print " --help this message\n"; - print " --board=b type of board\n"; - print " --path=p type of fpga\n"; -} diff --git a/tools/bin/isemsg_filter b/tools/bin/isemsg_filter new file mode 100755 index 00000000..427ab4c3 --- /dev/null +++ b/tools/bin/isemsg_filter @@ -0,0 +1,200 @@ +#!/usr/bin/perl -w +# $Id: isemsg_filter 406 2011-08-14 21:06:44Z mueller $ +# +# Copyright 2011- by Walter F.J. Mueller +# +# 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. +# +# Revision History: +# Date Rev Version Comment +# 2011-08-14 406 1.0 Initial version +# + +use 5.005; # require Perl 5.005 or higher +use strict; # require strict checking +use FileHandle; + +use Getopt::Long; + +my %opts = (); + +GetOptions(\%opts, "help", "pack") || exit 1; + +sub print_help; +sub read_mfs; +sub read_log; + +my $type = shift @ARGV; +my $mfsnam = shift @ARGV; +my $lognam = shift @ARGV; +my @flist; +my @mlist; +my $nackcnt = 0; +my $ackcnt = 0; +my $misscnt = 0; + + +autoflush STDOUT 1; # autoflush, so noting lost on exec later + +if (exists $opts{help}) { + print_help; + exit 0; +} + +if (!defined $type || !defined $mfsnam || !defined $lognam) { + print STDERR "%isemsg_filter-E: one of 'type mfs log' missing \n\n"; + print_help; + exit 1; +} + +if ($type !~ m{^(xst|tra|map|par|twr|bgn)$}) { + print STDERR "%isemsg_filter-E: type must be xst,tra,map,par,twr, or bgn\n"; + exit 1; +} + +if (read_mfs()) {exit 1;} +if (read_log()) {exit 1;} + +foreach (@mlist) { + my $msgorig = $_->[0]; + my $msgflat = $_->[1]; + my $msgmatch = 0; + foreach (@flist) { + my $filt = $_->[0]; + if ($msgflat =~ m{$filt}) { + $_->[1] += 1; + $msgmatch = 1; + last; + } + } + if ($msgmatch) { + $_->[2] += 1; + } else { + $nackcnt += 1; + } +} + +if ($nackcnt) { + print "Non-acknowledged messages of type [$type] from $lognam:\n"; + foreach (@mlist) { + next if $_->[2]; + print $_->[0] . "\n"; + } + print "\n"; +} + +foreach (@flist) { + if ($_->[1]) { + $ackcnt += 1; + } else { + $misscnt += 1; + } +} + +if ($ackcnt && exists $opts{pack}) { + print "Acknowledged messages of type [$type] from $lognam:\n"; + foreach (@flist) { + next if $_->[1] == 0; + printf "%4d: %s\n", $_->[1], $_->[0]; + } + print "\n"; +} + +if ($misscnt) { + print "Missed acknowledged messages of type [$type] from $lognam:\n"; + foreach (@flist) { + next if $_->[1] != 0; + printf "%4d: %s\n", $_->[1], $_->[0]; + } + print "\n"; +} + +#------------------------------------------------------------------------------- +sub read_mfs { + if (not -r $mfsnam) { + print STDERR "%isemsg_filter-E: \'$mfsnam\' not existing or readable\n"; + return 1; + } + + open (FFILE, $mfsnam) or die "can't open for read $mfsnam: $!"; + + my $intyp = 0; + + while () { + chomp; + next if /^\s*#/; # drop comments + next if /^\s*$/; # drop empty lines + + if (m{^\[([a-z]{3})\]$}) { + if ($1 eq $type) { + $intyp = 1; + } else { + $intyp = 0; + } + } else { + if ($intyp) { + push @flist, [$_, 0]; + } + } + } + + close (FFILE); + return 0; +} + +#------------------------------------------------------------------------------- +sub read_log { + if (not -r $lognam) { + print STDERR "%isemsg_filter-E: \'$lognam\' not existing or readable\n"; + return 1; + } + + open (LFILE, $lognam) or die "can't open for read $lognam: $!"; + + my $msgorig = ""; + my $msgflat = ""; + my $inmsg = 0; + + while () { + chomp; + if (m{^(INFO|WARNING|ERROR):}) { + if ($inmsg) {push @mlist, [$msgorig, $msgflat, 0];} + $inmsg = 1; + $msgorig = $_; + $msgflat = $_; + } elsif ($inmsg && m{^\s\s\s\S}) { + $msgorig .= "\n" . $_; + my $txt = $_; + $txt =~ s{\s\s}{}; # replace 3 leading blanks by one ! + $msgflat .= $txt; + } else { + if ($inmsg) {push @mlist, [$msgorig, $msgflat, 0];} + $inmsg = 0; + } + } + + if ($inmsg) {push @mlist, [$msgorig, $msgflat, 0];} + + close (LFILE); + + return 0; +} + +#------------------------------------------------------------------------------- + +sub print_help { + print "usage: isemsg_filter [options] type mfs log\n"; + print " type log file type: xst,tra,map,par,twr, or bgn\n"; + print " mfs message filter setup file\n"; + print " log log file\n"; + print " Options:\n"; + print " --pack print summary of acknowledged messages\n"; + print " --help this message\n"; +} diff --git a/tools/bin/ti_rri b/tools/bin/ti_rri index 179ee8d9..800128d6 100755 --- a/tools/bin/ti_rri +++ b/tools/bin/ti_rri @@ -1,6 +1,6 @@ #! /usr/bin/env tclsh # -*- tcl -*- -# $Id: ti_rri 376 2011-04-17 12:24:07Z mueller $ +# $Id: ti_rri 386 2011-07-01 17:31:03Z mueller $ # # Copyright 2011- by Walter F.J. Mueller # @@ -15,6 +15,7 @@ # # Revision History: # Date Rev Version Comment +# 2011-04-22 379 1.0.1 check for RETROBASE; proper exit handling; help text # 2011-04-17 376 1.0 Initial version # 2011-03-19 371 0.1 First draft # @@ -49,6 +50,29 @@ array set opts { set clist {} set optsendseen 0 +set runpid {} + +# +# cleanup handler +# must be in a proc so that it can be called from tclreadline +# must be defined before ::tclreadline::Loop called (all after ignored...) +# +proc exit_cleanup {} { + global opts + global runpid + + # now close rlink connection + if { $opts(fifo) || $opts(term) } { + rlc close + } + + # FIXME_code: should sync here with -run process run-down + # but no wait available in tcl (grr...) + if { "$runpid" ne "" } { + after 100; # currently just wait 100ms + } + return +} foreach arg $argv { if { $optsendseen } { @@ -74,10 +98,56 @@ foreach arg $argv { } if { $opts(help) } { - puts "usage: ti_rri" + # use {} as defimiter here to avoid that escaping of all [] + puts {usage: ti_rri [OPTION]... [COMMAND]...} + puts {} + puts {Options:} + puts { --run=CMD exec's CMD as subprocess before the rlink port opened} + puts { useful to start test benches, usually via 'tbw'} + puts { --fifo[=ARGS] open fifo type rlink port. Optional arguments are:} + puts { --fifo=[NAME[,KEEP]]} + puts { NAME fifo name prefix, default 'rlink_cext_fifo'} + puts { KEEP if non-empty the fifo is kept open on exit} + puts { --term[=ARGS] open term type rlink port. Optional arguments are:} + puts { --term=[NAME,[BAUD,[BREAK]]]} + puts { NAME tty device name, default 'USB0'} + puts { if not starting with '/' the name is} + puts { prefixed with '/dev/tty'} + puts { BAUD serial port baud rate, default '115k'} + puts { allowed baud rate settings are:} + puts { 9600, 19200, 19k, 38400, 38k, 57600, 57k} + puts { 115200, 115k, 230400, 230k, 460800, 460k} + puts { 500000, 500k, 921600, 921k, 1000000, 1M} + puts { 2000000, 2M, 3000000, 3M} + puts { --log=FILE set log file name. Default is to write to stdout.} + puts { --logl=LVL set log level, default is '2' allowed values:} + puts { 0 no logging} + puts { 1 log rlink commands with communication errors} + puts { 2 log rlink commands with failed checks} + puts { 3 log all rlink commands} + puts { --dmpl=LVL set dump level, default is '0', values like logl} + puts { --tiol=LVL set i/o trace level, default is '0', allowed values:} + puts { 0 no i/o trace} + puts { 1 trace buffer activities} + puts { 2 trace character activities} + puts { --int enter interactive mode even when commands given} + puts { --help display this help and exit} + puts { -- all following arguments are treated as tcl commands} + puts {} + puts {Command handling:} + puts { For arguments of the form '@.tcl' the respective file is} + puts { sourced. All other arguments are treated as Tcl commands and executed} + puts { with eval.} + puts {} + puts {For further details consults the ti_rri man page.} return 0 } +if {![info exists env(RETROBASE)]} { + puts "-E: RETROBASE environment variable not defined" + return 1 +} + if { $opts(fifo) && $opts(term) } { puts "-E: both --fifo and --term given, only one allowed" return 1 @@ -100,8 +170,7 @@ rlc config -logprintlevel $opts(logl_) rlc config -logdumplevel $opts(dmpl_) rlc config -logtracelevel $opts(tiol_) -# first start, if specified with -run, the test bench -set runpid {} +# first start, if specified with --run, the test bench if { $opts(run_) ne "" } { if { [catch {eval "exec $opts(run_) &" } runpid] } { puts "-E: failed to execute \"$opts(run_)\" with error message\n $runpid" @@ -130,7 +199,7 @@ if { $opts(term) } { set brk [lindex $nlist 2] if {$dev eq ""} {set dev "USB0"} if {$baud eq ""} {set baud "115k"} - if {! [regexp -- {^/dev} $dev]} { + if {! [regexp -- {^/} $dev]} { set dev "/dev/tty$dev" } set url "term:$dev?baud=$baud" @@ -187,21 +256,11 @@ if { $opts(int) || [llength $clist] == 0 } { return "ti_rri > " } } + ::tclreadline::readline eofchar {::exit_cleanup; puts {}; exit} ::tclreadline::Loop } -} - -# -# now close rlink connection -# -if { $opts(fifo) || $opts(term) } { - rlc close -} - -# FIXME_code: should sync here with -run process run-down -# but no wait available in tcl (grr...) -if { $runpid } { - after 100; # currently just wait 100ms +} else { + exit_cleanup } return 0 diff --git a/tools/bin/vbomconv b/tools/bin/vbomconv index c6633853..ce40a3c1 100755 --- a/tools/bin/vbomconv +++ b/tools/bin/vbomconv @@ -1,7 +1,7 @@ #!/usr/bin/perl -w -# $Id: vbomconv 314 2010-07-09 17:38:41Z mueller $ +# $Id: vbomconv 405 2011-08-14 08:16:28Z mueller $ # -# Copyright 2007-2010 by Walter F.J. Mueller +# Copyright 2007-2011 by Walter F.J. Mueller # # 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 @@ -14,6 +14,11 @@ # # Revision History: # Date Rev Version Comment +# 2011-08-13 405 1.9.1 always write 'vhdl' into xst prj files again; for +# -xst_export: remove opt file export, add ucf_cpp +# handling +# 2011-06-26 385 1.9 add --ise_path, pass it to vbomconv --xst_prj +# 2011-06-09 383 1.8.6 fix xst_vhdl.opt logic (use rtl/vlib now) # 2010-07-03 312 1.8.5 add --flist action # 2010-06-03 299 1.8.4 generate ucf->ncd dependencies in dep_xst # 2010-04-26 284 1.8.3 add _[sft]sim support for ISim @@ -46,7 +51,7 @@ use Getopt::Long; my %opts = (); -GetOptions(\%opts, "help", "trace", +GetOptions(\%opts, "help", "trace", "ise_path=s", "dep_xst", "dep_ghdl", "dep_isim", "xst_prj", "isim_prj", "ghdl_a", "ghdl_a_cmd", @@ -87,6 +92,14 @@ my $is_fsim; my $is_tsim; my $do_trace = exists $opts{trace}; my $level; +my $xst_writevhdl = 1; + +# now using '-ifmt mixed', so language always needed (2011-08-13) +#if (defined $opts{ise_path}) { +# if ($opts{ise_path} =~ /^xc6s/) { +# $xst_writevhdl = 0; +# } +#} autoflush STDOUT 1; # autoflush, so noting lost on exec later @@ -106,7 +119,7 @@ if (scalar(@ARGV) != 1) { # check that only one action is defined, mark xst, gdhl, or isim class foreach (keys %opts) { - $nactions += 1 unless ($_ eq "trace"); + $nactions += 1 unless ($_ eq "trace" || $_ eq "ise_path"); $is_xst = 1 if ($_ eq "dep_xst"); $is_ghdl = 1 if ($_ eq "dep_ghdl"); $is_isim = 1 if ($_ eq "dep_isim"); @@ -307,8 +320,11 @@ if (exists $opts{ghdl_m} || exists $opts{ghdl_m_cmd} ) { if (exists $opts{xst_prj}) { foreach (@file_list) { - print "vhdl work $_\n"; -# print "work $_\n"; # for ISE 11.2 S-6/V-6 compilations + if ($xst_writevhdl) { + print "vhdl work $_\n"; + } else { + print "work $_\n"; # for ISE S-6/V-6 compilations with '-ifmt VHDL' + } } } @@ -484,17 +500,18 @@ if (exists $opts{xst_export} or close(PFILE); + # Note: currently no xflow opt files exported !! if (exists $opts{xst_export}) { - copy_edir($ENV{RETROBASE}."/vlib/xst_vhdl.opt", $edir) - if (defined $ENV{RETROBASE} || -r $ENV{RETROBASE}."/vlib/xst_vhdl.opt"); - - copy_edir("xst_vhdl.opt", $edir) if (-r "xst_vhdl.opt"); - open(XFILE, ">$edir/$stem.xcf") or die "can't write open $edir/$stem.xcf: $!"; close(XFILE); + foreach(glob("*.xcf")) { copy_edir($_, $edir); } + if (-r "$stem.ucf_cpp") { + system "/bin/sh", "-c", "make $stem.ucf"; + } + foreach(glob("*.ucf")) { copy_edir($_, $edir); } } diff --git a/tools/dox/w11.Doxyfile b/tools/dox/w11.Doxyfile index b556e4f5..9b16c806 100644 --- a/tools/dox/w11.Doxyfile +++ b/tools/dox/w11.Doxyfile @@ -1,4 +1,4 @@ -# $Id: $ +# $Id: w11.Doxyfile 403 2011-08-06 17:36:22Z mueller $ # Revision History: # Date Rev Version Comment # 2011-01-09 354 1.0 Initial version diff --git a/tools/src/Makefile b/tools/src/Makefile index d24e164c..8954a101 100644 --- a/tools/src/Makefile +++ b/tools/src/Makefile @@ -1,10 +1,11 @@ -# $Id: Makefile 372 2011-03-20 22:48:11Z mueller $ +# $Id: Makefile 401 2011-07-31 21:02:33Z mueller $ # # Top level makefile, using the recipe found in # http://www.lackof.org/taggart/hacking/make-example/ # # Revision History: # Date Rev Version Comment +# 2011-07-31 401 1.2 rename realclean->distclean # 2011-03-20 372 1.1.1 renamed ..tcl -> ..tpp # 2011-03-14 370 1.1.0 rename librtoolstcl -> librtcltools # 2011-02-13 361 1.1 add realclean rule; add dirs and dependencies @@ -18,9 +19,9 @@ DIRS += librlinktpp # BUILDDIRS = $(DIRS:%=build-%) CLEANDIRS = $(DIRS:%=clean-%) -REALCDIRS = $(DIRS:%=realc-%) +REALCDIRS = $(DIRS:%=distc-%) # -.PHONY: all clean realclean +.PHONY: all clean distclean .PHONY: $(DIRS) .PHONY: $(BUILDDIRS) .PHONY: $(CLEANDIRS) @@ -44,8 +45,8 @@ clean: $(CLEANDIRS) $(CLEANDIRS): $(MAKE) -C $(@:clean-%=%) clean # -# realclean rule +# distclean rule # -realclean: $(REALCDIRS) +distclean: $(REALCDIRS) $(REALCDIRS): - $(MAKE) -C $(@:realc-%=%) realclean + $(MAKE) -C $(@:distc-%=%) distclean diff --git a/tools/src/librlink/Makefile b/tools/src/librlink/Makefile index ef9a4146..5b876f66 100644 --- a/tools/src/librlink/Makefile +++ b/tools/src/librlink/Makefile @@ -1,7 +1,9 @@ -# $Id: $ +# $Id: Makefile 403 2011-08-06 17:36:22Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-07-31 401 1.1 rename realclean->distclean +# 2011-07-01 386 1.0.1 add BOOSTINC # 2011-01-09 354 1.0 Initial version (adopted from CTB...) #--- # @@ -13,8 +15,8 @@ SOMINV = 0 # # Compile and Link search paths # -INCLFLAGS = -I${RETROBASE}/tools/src -LDLIBS = -L${RETROBASE}/tools/lib -lrtools +INCLFLAGS = -I${RETROBASE}/tools/src -I${BOOSTINC} +LDLIBS = -lboost_thread -L${RETROBASE}/tools/lib -lrtools # # Object files to be included # @@ -42,7 +44,7 @@ include $(DEP_all) # # cleanup phonies: # -.PHONY : clean cleandep realclean +.PHONY : clean cleandep distclean clean : @ rm -f $(OBJ_all) @ echo "Object files removed" @@ -51,7 +53,7 @@ cleandep : @ rm -f $(DEP_all) @ echo "Dependency files removed" # -realclean : clean cleandep +distclean : clean cleandep @ rm -f $(SOPATH)/lib$(SONAME).a $(SOPATH)/lib$(SONAME).so* @ echo "Libraries removed" # diff --git a/tools/src/librlink/RlinkCommandList.cpp b/tools/src/librlink/RlinkCommandList.cpp index 5d5d9fb3..ca8c7cf9 100644 --- a/tools/src/librlink/RlinkCommandList.cpp +++ b/tools/src/librlink/RlinkCommandList.cpp @@ -1,4 +1,4 @@ -// $Id: RlinkCommandList.cpp 375 2011-04-02 07:56:47Z mueller $ +// $Id: RlinkCommandList.cpp 380 2011-04-25 18:14:52Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,19 +13,23 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-25 380 1.0.1 use boost/foreach // 2011-03-05 366 1.0 Initial version // 2011-01-15 355 0.1 First draft // --------------------------------------------------------------------------- /*! \file - \version $Id: RlinkCommandList.cpp 375 2011-04-02 07:56:47Z mueller $ + \version $Id: RlinkCommandList.cpp 380 2011-04-25 18:14:52Z mueller $ \brief Implemenation of class RlinkCommandList. */ #include #include +#include "boost/foreach.hpp" +#define foreach BOOST_FOREACH + #include "RlinkCommandList.hpp" #include "librtools/RosPrintf.hpp" @@ -62,7 +66,7 @@ RlinkCommandList::RlinkCommandList(const RlinkCommandList& rhs) RlinkCommandList::~RlinkCommandList() { - for (size_t i=0; iPrint(os, pamap, abase, dbase, sbase); + foreach (RlinkCommand* pcmd, fList) { + pcmd->Print(os, pamap, abase, dbase, sbase); } return; } @@ -254,7 +258,8 @@ RlinkCommandList& Retro::RlinkCommandList::operator=( const RlinkCommandList& rhs) { if (&rhs == this) return *this; - for (size_t i=0; i // @@ -13,26 +13,30 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-25 380 1.1 use boost::(mutex&lock), implement Lockable IF +// 2011-04-22 379 1.0.1 add Lock(), Unlock(), lock connect in Exec() // 2011-04-02 375 1.0 Initial version // 2011-01-15 356 0.1 First draft // --------------------------------------------------------------------------- /*! \file - \version $Id: RlinkConnect.cpp 375 2011-04-02 07:56:47Z mueller $ + \version $Id: RlinkConnect.cpp 386 2011-07-01 17:31:03Z mueller $ \brief Implemenation of RlinkConnect. */ #include - #include +#include "boost/thread/locks.hpp" + #include "RlinkConnect.hpp" #include "RlinkPortFactory.hpp" #include "librtools/RosFill.hpp" #include "librtools/RosPrintf.hpp" #include "librtools/RosPrintBvi.hpp" +#include "librtools/Rtools.hpp" using namespace std; using namespace Retro; @@ -52,10 +56,12 @@ RlinkConnect::RlinkConnect() fAddrMap(), fStats(), fLogOpts(), - fLogFile(&cout) + fLogFile(&cout), + fMutexConn() { for (size_t i=0; i<8; i++) fSeqNumber[i] = 0; - + + // Statistic setup fStats.Define(kStatNExec, "NExec", "Exec() calls"); fStats.Define(kStatNSplitVol, "NSplitVol", "clist splits: Volatile"); fStats.Define(kStatNExecPart, "NExecPart", "ExecPart() calls"); @@ -88,7 +94,7 @@ RlinkConnect::RlinkConnect() RlinkConnect::~RlinkConnect() { - delete fpPort; + if (fpPort) Close(); } //------------------------------------------+----------------------------------- @@ -128,13 +134,41 @@ void RlinkConnect::Close() //------------------------------------------+----------------------------------- //! FIXME_docs -bool RlinkConnect::Exec(RlinkCommandList& clist, RerrMsg& emsg) +void RlinkConnect::lock() { + fMutexConn.lock(); + return; +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + +bool RlinkConnect::try_lock() +{ + return fMutexConn.try_lock(); +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + +void RlinkConnect::unlock() +{ + fMutexConn.unlock(); + return; +} + +//------------------------------------------+----------------------------------- +//! FIXME_docs + +bool RlinkConnect::Exec(RlinkCommandList& clist, RerrMsg& emsg) +{ if (clist.Size() == 0) throw invalid_argument("RlinkConnect::Exec(): clist empty"); if (! IsOpen()) throw logic_error("RlinkConnect::Exec(): port not open"); + boost::lock_guard lock(*this); + fStats.Inc(kStatNExec); size_t ibeg = 0; diff --git a/tools/src/librlink/RlinkConnect.hpp b/tools/src/librlink/RlinkConnect.hpp index 3d05feef..1b2319ef 100644 --- a/tools/src/librlink/RlinkConnect.hpp +++ b/tools/src/librlink/RlinkConnect.hpp @@ -1,4 +1,4 @@ -// $Id: RlinkConnect.hpp 375 2011-04-02 07:56:47Z mueller $ +// $Id: RlinkConnect.hpp 380 2011-04-25 18:14:52Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,6 +13,9 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-24 380 1.1 use boost::noncopyable (instead of private dcl's); +// use boost::(mutex&lock), implement Lockable IF +// 2011-04-22 379 1.0.1 add Lock(), Unlock() // 2011-04-02 375 1.0 Initial version // 2011-01-15 356 0.1 First draft // --------------------------------------------------------------------------- @@ -20,7 +23,7 @@ /*! \file - \version $Id: RlinkConnect.hpp 375 2011-04-02 07:56:47Z mueller $ + \version $Id: RlinkConnect.hpp 380 2011-04-25 18:14:52Z mueller $ \brief Declaration of class \c RlinkConnect. */ @@ -32,6 +35,9 @@ #include #include +#include "boost/utility.hpp" +#include "boost/thread/recursive_mutex.hpp" + #include "librtools/RerrMsg.hpp" #include "librtools/Rstats.hpp" #include "librtools/RlogFile.hpp" @@ -43,7 +49,7 @@ namespace Retro { - class RlinkConnect { + class RlinkConnect : private boost::noncopyable { public: struct LogOpts { size_t baseaddr; @@ -67,9 +73,12 @@ namespace Retro { bool IsOpen() const; RlinkPort* Port() const; + // provide boost Lockable interface + void lock(); + bool try_lock(); + void unlock(); + bool Exec(RlinkCommandList& clist, RerrMsg& emsg); - bool ExecPart(RlinkCommandList& clist, size_t ibeg, size_t iend, - RerrMsg& emsg); double WaitAttn(double timeout, RerrMsg& emsg); bool SndOob(uint16_t addr, uint16_t data, RerrMsg& emsg); @@ -91,7 +100,6 @@ namespace Retro { void Print(std::ostream& os) const; void Dump(std::ostream& os, int ind=0, const char* text=0) const; - // statistics counter indices enum stats { kStatNExec = 0, @@ -122,6 +130,10 @@ namespace Retro { kDimStat }; + protected: + bool ExecPart(RlinkCommandList& clist, size_t ibeg, size_t iend, + RerrMsg& emsg); + protected: RlinkPort* fpPort; //!< ptr to port uint8_t fSeqNumber[8]; //!< command sequence number @@ -131,11 +143,7 @@ namespace Retro { Rstats fStats; //!< statistics LogOpts fLogOpts; //!< log options RlogFile fLogFile; //!< connection log file - - // RlinkConnect is not copyable and assignable - private: - RlinkConnect(const RlinkConnect& rhs); - RlinkConnect& operator=(const RlinkConnect& rhs); + boost::recursive_mutex fMutexConn; //!< mutex to lock whole connect }; } // end namespace Retro diff --git a/tools/src/librlink/RlinkPort.hpp b/tools/src/librlink/RlinkPort.hpp index 8ff4d13d..4c0b6948 100644 --- a/tools/src/librlink/RlinkPort.hpp +++ b/tools/src/librlink/RlinkPort.hpp @@ -1,4 +1,4 @@ -// $Id: RlinkPort.hpp 375 2011-04-02 07:56:47Z mueller $ +// $Id: RlinkPort.hpp 380 2011-04-25 18:14:52Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-24 380 1.0.1 use boost::noncopyable (instead of private dcl's) // 2011-03-27 375 1.0 Initial version // 2011-01-15 356 0.1 First draft // --------------------------------------------------------------------------- @@ -20,7 +21,7 @@ /*! \file - \version $Id: RlinkPort.hpp 375 2011-04-02 07:56:47Z mueller $ + \version $Id: RlinkPort.hpp 380 2011-04-25 18:14:52Z mueller $ \brief Declaration of class RlinkPort. */ @@ -30,13 +31,15 @@ #include #include +#include "boost/utility.hpp" + #include "librtools/RerrMsg.hpp" #include "librtools/RlogFile.hpp" #include "librtools/Rstats.hpp" namespace Retro { - class RlinkPort { + class RlinkPort : private boost::noncopyable { public: typedef std::map omap_t; typedef omap_t::iterator omap_it_t; @@ -106,12 +109,6 @@ namespace Retro { RlogFile* fpLogFile; //!< ptr to log file dsc size_t fTraceLevel; //!< trace level Rstats fStats; //!< statistics - - // RlinkPort is not copyable and assignable - private: - RlinkPort(const RlinkPort& rhs); - RlinkPort& operator=(const RlinkPort& rhs); - }; } // end namespace Retro diff --git a/tools/src/librlink/RlinkPortTerm.cpp b/tools/src/librlink/RlinkPortTerm.cpp index 08bb7204..7ac4032d 100644 --- a/tools/src/librlink/RlinkPortTerm.cpp +++ b/tools/src/librlink/RlinkPortTerm.cpp @@ -1,4 +1,4 @@ -// $Id: RlinkPortTerm.cpp 375 2011-04-02 07:56:47Z mueller $ +// $Id: RlinkPortTerm.cpp 388 2011-07-06 18:40:47Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,12 +13,13 @@ // // Revision History: // Date Rev Version Comment +// 2011-07-04 388 1.0.1 add termios readback and verification // 2011-03-27 374 1.0 Initial version // --------------------------------------------------------------------------- /*! \file - \version $Id: RlinkPortTerm.cpp 375 2011-04-02 07:56:47Z mueller $ + \version $Id: RlinkPortTerm.cpp 388 2011-07-06 18:40:47Z mueller $ \brief Implemenation of RlinkPortTerm. */ @@ -155,6 +156,39 @@ bool RlinkPortTerm::Open(const std::string& url, RerrMsg& emsg) return false; } + // tcsetattr() returns success if any of the requested changes could be + // successfully carried out. Therefore the termios structure is read back + // and verified. + + struct termios tios; + if (tcgetattr(fd, &tios) != 0) { + emsg.InitErrno("RlinkPortTerm::Open()", + string("2nd tcgetattr() for \"") + fPath + + string("\" failed: "), + errno); + close(fd); + return false; + } + + const char* pmsg = 0; + if (tios.c_iflag != fTiosNew.c_iflag) pmsg = "c_iflag"; + if (tios.c_oflag != fTiosNew.c_oflag) pmsg = "c_oflag"; + if (tios.c_cflag != fTiosNew.c_cflag) pmsg = "c_cflag"; + if (tios.c_lflag != fTiosNew.c_lflag) pmsg = "c_lflag"; + if (cfgetispeed(&tios) != speed) pmsg = "ispeed"; + if (cfgetospeed(&tios) != speed) pmsg = "ospeed"; + for (int i=0; idistclean +# 2011-07-01 386 1.0.2 add BOOSTINC # 2011-03-20 372 1.0.1 renamed ..tcl -> ..tpp # 2011-02-12 360 1.0 Initial version #--- @@ -14,7 +16,7 @@ SOMINV = 0 # # Compile and Link search paths # -INCLFLAGS = -I/usr/include/tcl8.4 -I${RETROBASE}/tools/src +INCLFLAGS = -I/usr/include/tcl8.4 -I${RETROBASE}/tools/src -I${BOOSTINC} LDLIBS = -L${RETROBASE}/tools/lib -lrtools -lrtcltools -lrlink # # Object files to be included @@ -39,7 +41,7 @@ include $(DEP_all) # # cleanup phonies: # -.PHONY : clean cleandep realclean +.PHONY : clean cleandep distclean clean : @ rm -f $(OBJ_all) @ echo "Object files removed" @@ -48,7 +50,7 @@ cleandep : @ rm -f $(DEP_all) @ echo "Dependency files removed" # -realclean : clean cleandep +distclean : clean cleandep @ rm -f $(SOPATH)/lib$(SONAME).a $(SOPATH)/lib$(SONAME).so* @ echo "Libraries removed" # diff --git a/tools/src/librlinktpp/RtclRlinkConnect.cpp b/tools/src/librlinktpp/RtclRlinkConnect.cpp index 715dff2a..db170692 100644 --- a/tools/src/librlinktpp/RtclRlinkConnect.cpp +++ b/tools/src/librlinktpp/RtclRlinkConnect.cpp @@ -1,4 +1,4 @@ -// $Id: RtclRlinkConnect.cpp 376 2011-04-17 12:24:07Z mueller $ +// $Id: RtclRlinkConnect.cpp 380 2011-04-25 18:14:52Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-23 380 1.1 use boost/bind instead of RmethDsc // 2011-04-17 376 1.0.1 M_wtlam: now correct log levels // 2011-03-27 374 1.0 Initial version // 2011-02-11 360 0.1 First draft @@ -20,7 +21,7 @@ /*! \file - \version $Id: RtclRlinkConnect.cpp 376 2011-04-17 12:24:07Z mueller $ + \version $Id: RtclRlinkConnect.cpp 380 2011-04-25 18:14:52Z mueller $ \brief Implemenation of class RtclRlinkConnect. */ @@ -29,11 +30,12 @@ #include #include +#include "boost/bind.hpp" + #include "librtcltools/Rtcl.hpp" #include "librtcltools/RtclOPtr.hpp" #include "librtcltools/RtclNameSet.hpp" #include "librtcltools/RtclStats.hpp" -#include "librtools/RmethDsc.hpp" #include "librtools/RosPrintf.hpp" #include "librlink/RlinkCommandList.hpp" #include "RtclRlinkConnect.hpp" @@ -55,20 +57,19 @@ RtclRlinkConnect::RtclRlinkConnect(Tcl_Interp* interp, const char* name) fErrCnt(0), fLogFileName("-") { - typedef RmethDsc mdsc_t; - AddMeth("open", new mdsc_t(this, &RtclRlinkConnect::M_open)); - AddMeth("close", new mdsc_t(this, &RtclRlinkConnect::M_close)); - AddMeth("exec", new mdsc_t(this, &RtclRlinkConnect::M_exec)); - AddMeth("amap", new mdsc_t(this, &RtclRlinkConnect::M_amap)); - AddMeth("errcnt", new mdsc_t(this, &RtclRlinkConnect::M_errcnt)); - AddMeth("wtlam", new mdsc_t(this, &RtclRlinkConnect::M_wtlam)); - AddMeth("oob", new mdsc_t(this, &RtclRlinkConnect::M_oob)); - AddMeth("stats", new mdsc_t(this, &RtclRlinkConnect::M_stats)); - AddMeth("log", new mdsc_t(this, &RtclRlinkConnect::M_log)); - AddMeth("print", new mdsc_t(this, &RtclRlinkConnect::M_print)); - AddMeth("dump", new mdsc_t(this, &RtclRlinkConnect::M_dump)); - AddMeth("config", new mdsc_t(this, &RtclRlinkConnect::M_config)); - AddMeth("$default", new mdsc_t(this, &RtclRlinkConnect::M_default)); + AddMeth("open", boost::bind(&RtclRlinkConnect::M_open, this, _1)); + AddMeth("close", boost::bind(&RtclRlinkConnect::M_close, this, _1)); + AddMeth("exec", boost::bind(&RtclRlinkConnect::M_exec, this, _1)); + AddMeth("amap", boost::bind(&RtclRlinkConnect::M_amap, this, _1)); + AddMeth("errcnt", boost::bind(&RtclRlinkConnect::M_errcnt, this, _1)); + AddMeth("wtlam", boost::bind(&RtclRlinkConnect::M_wtlam, this, _1)); + AddMeth("oob", boost::bind(&RtclRlinkConnect::M_oob, this, _1)); + AddMeth("stats", boost::bind(&RtclRlinkConnect::M_stats, this, _1)); + AddMeth("log", boost::bind(&RtclRlinkConnect::M_log, this, _1)); + AddMeth("print", boost::bind(&RtclRlinkConnect::M_print, this, _1)); + AddMeth("dump", boost::bind(&RtclRlinkConnect::M_dump, this, _1)); + AddMeth("config", boost::bind(&RtclRlinkConnect::M_config, this, _1)); + AddMeth("$default", boost::bind(&RtclRlinkConnect::M_default, this, _1)); for (size_t i=0; i<8; i++) { fCmdnameObj[i] = Tcl_NewStringObj(RlinkCommand::CommandName(i), -1); diff --git a/tools/src/librtcltools/Makefile b/tools/src/librtcltools/Makefile index f08fe3a4..7f41c7e3 100644 --- a/tools/src/librtcltools/Makefile +++ b/tools/src/librtcltools/Makefile @@ -1,7 +1,9 @@ -# $Id: Makefile 370 2011-03-14 18:33:43Z mueller $ +# $Id: Makefile 401 2011-07-31 21:02:33Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-07-31 401 1.1 rename realclean->distclean +# 2011-07-01 386 1.0.1 add BOOSTINC # 2011-02-11 360 1.0 Initial version #--- # @@ -13,7 +15,7 @@ SOMINV = 0 # # Compile and Link search paths # -INCLFLAGS = -I/usr/include/tcl8.4 -I${RETROBASE}/tools/src +INCLFLAGS = -I/usr/include/tcl8.4 -I${RETROBASE}/tools/src -I${BOOSTINC} LDLIBS = -L${RETROBASE}/tools/lib -lrtools # # Object files to be included @@ -39,7 +41,7 @@ include $(DEP_all) # # cleanup phonies: # -.PHONY : clean cleandep realclean +.PHONY : clean cleandep distclean clean : @ rm -f $(OBJ_all) @ echo "Object files removed" @@ -48,7 +50,7 @@ cleandep : @ rm -f $(DEP_all) @ echo "Dependency files removed" # -realclean : clean cleandep +distclean : clean cleandep @ rm -f $(SOPATH)/lib$(SONAME).a $(SOPATH)/lib$(SONAME).so* @ echo "Libraries removed" # diff --git a/tools/src/librtcltools/RtclClassBase.hpp b/tools/src/librtcltools/RtclClassBase.hpp index 78c54d12..05a19448 100644 --- a/tools/src/librtcltools/RtclClassBase.hpp +++ b/tools/src/librtcltools/RtclClassBase.hpp @@ -1,4 +1,4 @@ -// $Id: RtclClassBase.hpp 365 2011-02-28 07:28:26Z mueller $ +// $Id: RtclClassBase.hpp 380 2011-04-25 18:14:52Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,24 +13,27 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-24 380 1.0.1 use boost::noncopyable (instead of private dcl's) // 2011-02-20 363 1.0 Initial version // 2011-02-11 360 0.1 First draft // --------------------------------------------------------------------------- /*! \file - \version $Id: RtclClassBase.hpp 365 2011-02-28 07:28:26Z mueller $ + \version $Id: RtclClassBase.hpp 380 2011-04-25 18:14:52Z mueller $ \brief Declaration of class RtclClassBase. */ #ifndef included_Retro_RtclClassBase #define included_Retro_RtclClassBase 1 +#include "boost/utility.hpp" + #include "tcl.h" namespace Retro { - class RtclClassBase { + class RtclClassBase : private boost::noncopyable { public: static const int kOK = TCL_OK; static const int kERR = TCL_ERROR; @@ -64,13 +67,6 @@ namespace Retro { std::string fType; //!< classed type name Tcl_Interp* fInterp; //!< tcl interpreter Tcl_Command fCmdToken; //!< cmd token for class command - - // RtclClassBase is not copy or assignable - private: - RtclClassBase(const RtclClassBase& rhs); - RtclClassBase& operator=(const RtclClassBase& rhs); - - }; } // end namespace Retro diff --git a/tools/src/librtcltools/RtclContext.hpp b/tools/src/librtcltools/RtclContext.hpp index 52c1ca16..3d98bf2a 100644 --- a/tools/src/librtcltools/RtclContext.hpp +++ b/tools/src/librtcltools/RtclContext.hpp @@ -1,4 +1,4 @@ -// $Id: RtclContext.hpp 368 2011-03-12 09:58:53Z mueller $ +// $Id: RtclContext.hpp 380 2011-04-25 18:14:52Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,6 +13,7 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-24 380 1.0.2 use boost::noncopyable (instead of private dcl's) // 2011-03-12 368 1.0.1 drop fExitSeen, get exit handling right // 2011-02-18 362 1.0 Initial version // 2011-02-18 362 0.1 First draft @@ -20,7 +21,7 @@ /*! \file - \version $Id: RtclContext.hpp 368 2011-03-12 09:58:53Z mueller $ + \version $Id: RtclContext.hpp 380 2011-04-25 18:14:52Z mueller $ \brief Declaration of class RtclContext. */ @@ -33,12 +34,14 @@ #include #include +#include "boost/utility.hpp" + #include "RtclClassBase.hpp" #include "RtclProxyBase.hpp" namespace Retro { - class RtclContext { + class RtclContext : private boost::noncopyable { public: typedef std::set cset_t; typedef cset_t::iterator cset_it_t; @@ -73,12 +76,6 @@ namespace Retro { pset_t fSetProxy; //!< set for Proxy objects static xmap_t fMapContext; //!< map of contexts - - // RtclContext is not copy or assignable nor default constructable - private: - RtclContext(); - RtclContext(const RtclContext& rhs); - RtclContext& operator=(const RtclContext& rhs); }; } // end namespace Retro diff --git a/tools/src/librtcltools/RtclProxyBase.cpp b/tools/src/librtcltools/RtclProxyBase.cpp index f0cb1548..9af3b8c4 100644 --- a/tools/src/librtcltools/RtclProxyBase.cpp +++ b/tools/src/librtcltools/RtclProxyBase.cpp @@ -1,4 +1,4 @@ -// $Id: RtclProxyBase.cpp 374 2011-03-27 17:02:47Z mueller $ +// $Id: RtclProxyBase.cpp 401 2011-07-31 21:02:33Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,6 +13,8 @@ // // Revision History: // Date Rev Version Comment +// 2011-07-31 401 1.2 add ctor(type,interp,name) for direct usage +// 2011-04-23 380 1.1 use boost/function instead of RmethDsc // 2011-03-05 366 1.0.1 use AppendResultNewLines() in exception catcher // 2011-02-20 363 1.0 Initial version // 2011-02-11 360 0.1 First draft @@ -20,7 +22,7 @@ /*! \file - \version $Id: RtclProxyBase.cpp 374 2011-03-27 17:02:47Z mueller $ + \version $Id: RtclProxyBase.cpp 401 2011-07-31 21:02:33Z mueller $ \brief Implemenation of RtclProxyBase. */ @@ -49,15 +51,24 @@ RtclProxyBase::RtclProxyBase(const std::string& type) fInterp(0) {} +//------------------------------------------+----------------------------------- +//! FIXME_docs + +RtclProxyBase::RtclProxyBase(const std::string& type, Tcl_Interp* interp, + const char* name) + : fType(type), + fMapMeth(), + fInterp(0) +{ + CreateObjectCmd(interp, name); +} + //------------------------------------------+----------------------------------- //! Destructor RtclProxyBase::~RtclProxyBase() { if (fInterp) RtclContext::Find(fInterp).UnRegisterProxy(this); - for (mmap_it_t it=fMapMeth.begin(); it!=fMapMeth.end(); it++) { - delete it->second; - } } //------------------------------------------+----------------------------------- @@ -76,10 +87,9 @@ int RtclProxyBase::ClassCmdConfig(Tcl_Interp* interp, int objc, //------------------------------------------+----------------------------------- //! FIXME_docs -void RtclProxyBase::AddMeth(const std::string& name, - RmethDscBase* pmeth) +void RtclProxyBase::AddMeth(const std::string& name, const methfo_t& methfo) { - mmap_ins_t ret = fMapMeth.insert(mmap_val_t(name, pmeth)); + mmap_ins_t ret = fMapMeth.insert(mmap_val_t(name, methfo)); if (ret.second == false) // or use !(ret.second) throw logic_error(string("RtclProxyBase::AddMeth: duplicate name: ") + name); @@ -106,7 +116,7 @@ void RtclProxyBase::CreateObjectCmd(Tcl_Interp* interp, const char* name) int RtclProxyBase::TclObjectCmd(Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]) { - mdsc_t* pmdsc = 0; + mmap_cit_t it_match; if (objc == 1) { // no args mmap_cit_t it = fMapMeth.find("$default"); // default method registered ? @@ -114,7 +124,7 @@ int RtclProxyBase::TclObjectCmd(Tcl_Interp* interp, int objc, Tcl_WrongNumArgs(interp, 1, objv, "option ?args?"); return TCL_ERROR; } - pmdsc = it->second; + it_match = it; } else { // at least method name given string name(Tcl_GetString(objv[1])); @@ -134,7 +144,7 @@ int RtclProxyBase::TclObjectCmd(Tcl_Interp* interp, int objc, return TCL_ERROR; } - pmdsc = it->second; + it_match = it; // check for ambiguous substring match if (name != it->first) { @@ -155,7 +165,7 @@ int RtclProxyBase::TclObjectCmd(Tcl_Interp* interp, int objc, } RtclArgs args(interp, objc, objv, 2); - return (*pmdsc)(args); + return (it_match->second)(args); } //------------------------------------------+----------------------------------- diff --git a/tools/src/librtcltools/RtclProxyBase.hpp b/tools/src/librtcltools/RtclProxyBase.hpp index afe13739..3bd085e4 100644 --- a/tools/src/librtcltools/RtclProxyBase.hpp +++ b/tools/src/librtcltools/RtclProxyBase.hpp @@ -1,4 +1,4 @@ -// $Id: RtclProxyBase.hpp 365 2011-02-28 07:28:26Z mueller $ +// $Id: RtclProxyBase.hpp 401 2011-07-31 21:02:33Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,13 +13,16 @@ // // Revision History: // Date Rev Version Comment +// 2011-07-31 401 1.2 add ctor(type,interp,name) for direct usage +// 2011-04-23 380 1.1 use boost/function instead of RmethDsc +// use boost::noncopyable (instead of private dcl's) // 2011-02-20 363 1.0 Initial version // 2011-02-11 360 0.1 First draft // --------------------------------------------------------------------------- /*! \file - \version $Id: RtclProxyBase.hpp 365 2011-02-28 07:28:26Z mueller $ + \version $Id: RtclProxyBase.hpp 401 2011-07-31 21:02:33Z mueller $ \brief Declaration of class RtclProxyBase. */ @@ -31,24 +34,28 @@ #include #include +#include "boost/utility.hpp" +#include "boost/function.hpp" + #include "RtclArgs.hpp" -#include "librtools/RmethDscBase.hpp" namespace Retro { - class RtclProxyBase { + class RtclProxyBase : private boost::noncopyable { public: static const int kOK = TCL_OK; static const int kERR = TCL_ERROR; - typedef std::map*> mmap_t; + typedef boost::function methfo_t; + + typedef std::map mmap_t; typedef mmap_t::iterator mmap_it_t; typedef mmap_t::const_iterator mmap_cit_t; typedef mmap_t::value_type mmap_val_t; - typedef RmethDscBase mdsc_t; - explicit RtclProxyBase(const std::string& type = std::string()); + RtclProxyBase(const std::string& type, Tcl_Interp* interp, + const char* name); virtual ~RtclProxyBase(); virtual int ClassCmdConfig(Tcl_Interp* interp, int objc, @@ -60,9 +67,8 @@ namespace Retro { protected: void SetType(const std::string& type); - void AddMeth(const std::string& name, - RmethDscBase* pmeth); - + void AddMeth(const std::string& name, const methfo_t& methfo); + void CreateObjectCmd(Tcl_Interp* interp, const char* name); int TclObjectCmd(Tcl_Interp* interp, int objc, @@ -78,11 +84,6 @@ namespace Retro { mmap_t fMapMeth; //!< map for named methods Tcl_Interp* fInterp; //!< tcl interpreter Tcl_Command fCmdToken; //!< cmd token for object command - - // RtclProxyBase is not copy or assignable - private: - RtclProxyBase(const RtclProxyBase& rhs); - RtclProxyBase& operator=(const RtclProxyBase& rhs); }; } // end namespace Retro diff --git a/tools/src/librtools/Makefile b/tools/src/librtools/Makefile index bba0c33d..76387fb2 100644 --- a/tools/src/librtools/Makefile +++ b/tools/src/librtools/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile 374 2011-03-27 17:02:47Z mueller $ +# $Id: Makefile 401 2011-07-31 21:02:33Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-07-31 401 1.1 rename realclean->distclean # 2011-03-27 374 1.0.1 removed Rnamed (obsolete now) # 2011-01-15 357 1.0 Initial version (adopted from CTB...) #--- @@ -42,7 +43,7 @@ include $(DEP_all) # # cleanup phonies: # -.PHONY : clean cleandep realclean +.PHONY : clean cleandep distclean clean : @ rm -f $(OBJ_all) @ echo "Object files removed" @@ -51,7 +52,7 @@ cleandep : @ rm -f $(DEP_all) @ echo "Dependency files removed" # -realclean : clean cleandep +distclean : clean cleandep @ rm -f $(SOPATH)/lib$(SONAME).a $(SOPATH)/lib$(SONAME).so* @ echo "Libraries removed" # diff --git a/tools/src/librtools/RlogFile.hpp b/tools/src/librtools/RlogFile.hpp index d3aa1eaa..02a88b2d 100644 --- a/tools/src/librtools/RlogFile.hpp +++ b/tools/src/librtools/RlogFile.hpp @@ -1,4 +1,4 @@ -// $Id: RlogFile.hpp 357 2011-01-31 08:00:13Z mueller $ +// $Id: RlogFile.hpp 380 2011-04-25 18:14:52Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -13,12 +13,13 @@ // // Revision History: // Date Rev Version Comment +// 2011-04-24 380 1.0.1 use boost::noncopyable (instead of private dcl's) // 2011-01-30 357 1.0 Initial version // --------------------------------------------------------------------------- /*! \file - \version $Id: RlogFile.hpp 357 2011-01-31 08:00:13Z mueller $ + \version $Id: RlogFile.hpp 380 2011-04-25 18:14:52Z mueller $ \brief Declaration of class RlogFile. */ @@ -29,9 +30,11 @@ #include #include +#include "boost/utility.hpp" + namespace Retro { - class RlogFile { + class RlogFile : private boost::noncopyable { public: RlogFile(); explicit RlogFile(std::ostream* os); @@ -53,13 +56,6 @@ namespace Retro { int fTagYear; //!< year of last time tag int fTagMonth; //!< month of last time tag int fTagDay; //!< day of last time tag - - // RlogFile is not copy or assignable - private: - RlogFile(const RlogFile& rhs); - RlogFile& operator=(const RlogFile& rhs); - - }; } // end namespace Retro diff --git a/tools/src/librtools/RmethDsc.hpp b/tools/src/librtools/RmethDsc.hpp deleted file mode 100644 index de42b89e..00000000 --- a/tools/src/librtools/RmethDsc.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// $Id: RmethDsc.hpp 360 2011-02-11 20:35:11Z mueller $ -// -// Copyright 2011- by Walter F.J. Mueller -// -// 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. -// -// Revision History: -// Date Rev Version Comment -// 2011-02-11 360 1.1 templetize object type TO and arglist type TA -// 2011-02-06 359 1.0 Initial version -// --------------------------------------------------------------------------- - -/*! - \file - \version $Id: RmethDsc.hpp 360 2011-02-11 20:35:11Z mueller $ - \brief Declaration of class RmethDsc . -*/ - -#include "RmethDscBase.hpp" - -#ifndef included_Retro_RmethDsc -#define included_Retro_RmethDsc 1 - -namespace Retro { - - template - class RmethDsc : public RmethDscBase { - public: - typedef int (TO::*pmeth_t) (TA& alist); - - RmethDsc(); - RmethDsc(TO* pobj, pmeth_t pmeth); - RmethDsc(const RmethDsc& rhs); - virtual ~RmethDsc(); - - virtual int operator()(TA& alist); - - private: - TO* fpObj; - pmeth_t fpMeth; - }; - -} // end namespace Retro - -// implementation is all inline -#include "RmethDsc.ipp" - -#endif diff --git a/tools/src/librtools/RmethDsc.ipp b/tools/src/librtools/RmethDsc.ipp deleted file mode 100644 index a5a36d9e..00000000 --- a/tools/src/librtools/RmethDsc.ipp +++ /dev/null @@ -1,88 +0,0 @@ -// $Id: RmethDsc.ipp 360 2011-02-11 20:35:11Z mueller $ -// -// Copyright 2011- by Walter F.J. Mueller -// -// 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. -// -// Revision History: -// Date Rev Version Comment -// 2011-02-11 360 1.1 templetize object type TO and arglist type TA -// 2011-02-06 359 1.0 Initial version -// --------------------------------------------------------------------------- - -/*! - \file - \version $Id: RmethDsc.ipp 360 2011-02-11 20:35:11Z mueller $ - \brief Implemenation (inline) of RmethDsc -*/ - -// all method definitions in namespace Retro (avoid using in includes...) -namespace Retro { - -/*! - \class RmethDsc - \brief FIXME_text -*/ - -//------------------------------------------+----------------------------------- -/*! - \brief Default constructor. -*/ - -template -inline RmethDsc::RmethDsc() - : fpObj(), - fpMeth() -{} - -//------------------------------------------+----------------------------------- -/*! - \brief FIXME_text -*/ - -template -inline RmethDsc::RmethDsc(TO* pobj, pmeth_t pmeth) - : fpObj(pobj), - fpMeth(pmeth) -{} - -//------------------------------------------+----------------------------------- -/*! - \brief Copy constructor. -*/ - -template -inline RmethDsc::RmethDsc(const RmethDsc& rhs) - : fpObj(rhs.fpObj), - fpMeth(rhs.fpMeth) -{} - -//------------------------------------------+----------------------------------- -/*! - \brief Destructor. -*/ - -template -inline RmethDsc::~RmethDsc() -{} - -//------------------------------------------+----------------------------------- -/*! - \brief FIXME_text -*/ - -template -inline int RmethDsc::operator()(TA& alist) -{ - return (fpObj->*fpMeth)(alist); -} - - -} // end namespace Retro diff --git a/tools/src/librtools/RmethDscBase.hpp b/tools/src/librtools/RmethDscBase.hpp deleted file mode 100644 index 98e46d7c..00000000 --- a/tools/src/librtools/RmethDscBase.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// $Id: RmethDscBase.hpp 360 2011-02-11 20:35:11Z mueller $ -// -// Copyright 2011- by Walter F.J. Mueller -// -// 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. -// -// Revision History: -// Date Rev Version Comment -// 2011-02-11 360 1.1 templetize arglist type -// 2011-02-06 359 1.0 Initial version -// --------------------------------------------------------------------------- - -/*! - \file - \version $Id: RmethDscBase.hpp 360 2011-02-11 20:35:11Z mueller $ - \brief Declaration of class RmethDscBase . -*/ - -#ifndef included_Retro_RmethDscBase -#define included_Retro_RmethDscBase 1 - -namespace Retro { - - template - class RmethDscBase { - public: - RmethDscBase(); - RmethDscBase(const RmethDscBase& rhs); - virtual ~RmethDscBase(); - - virtual int operator()(TA& alist)=0; - - private: - }; - -} // end namespace Retro - -// implementation is all inline -#include "RmethDscBase.ipp" - -#endif diff --git a/tools/src/librtools/RmethDscBase.ipp b/tools/src/librtools/RmethDscBase.ipp deleted file mode 100644 index f62d9789..00000000 --- a/tools/src/librtools/RmethDscBase.ipp +++ /dev/null @@ -1,62 +0,0 @@ -// $Id: RmethDscBase.ipp 365 2011-02-28 07:28:26Z mueller $ -// -// Copyright 2011- by Walter F.J. Mueller -// -// 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. -// -// Revision History: -// Date Rev Version Comment -// 2011-02-11 360 1.1 templetize arglist type -// 2011-02-06 359 1.0 Initial version -// --------------------------------------------------------------------------- - -/*! - \file - \version $Id: RmethDscBase.ipp 365 2011-02-28 07:28:26Z mueller $ - \brief Implemenation (inline) of RmethDscBase -*/ - -// all method definitions in namespace Retro (avoid using in includes...) -namespace Retro { - -/*! - \class RmethDscBase - \brief FIXME_docs -*/ - -//------------------------------------------+----------------------------------- -/*! - \brief Default constructor. -*/ - -template -inline RmethDscBase::RmethDscBase() -{} - -//------------------------------------------+----------------------------------- -/*! - \brief Copy constructor. -*/ - -template -inline RmethDscBase::RmethDscBase(const RmethDscBase& rhs) -{} - -//------------------------------------------+----------------------------------- -/*! - \brief Destructor. -*/ - -template -inline RmethDscBase::~RmethDscBase() -{} - - -} // end namespace Retro diff --git a/tools/src/librtools/RosPrintfBase.cpp b/tools/src/librtools/RosPrintfBase.cpp index 3751d4c9..8b343190 100644 --- a/tools/src/librtools/RosPrintfBase.cpp +++ b/tools/src/librtools/RosPrintfBase.cpp @@ -1,4 +1,4 @@ -// $Id: $ +// $Id: RosPrintfBase.cpp 403 2011-08-06 17:36:22Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -18,7 +18,7 @@ /*! \file - \version $Id: $ + \version $Id: RosPrintfBase.cpp 403 2011-08-06 17:36:22Z mueller $ \brief Implemenation of RosPrintfBase . */ diff --git a/tools/src/librtools/Rtools.cpp b/tools/src/librtools/Rtools.cpp index 29689226..fc8fb4e2 100644 --- a/tools/src/librtools/Rtools.cpp +++ b/tools/src/librtools/Rtools.cpp @@ -1,4 +1,4 @@ -// $Id: $ +// $Id: Rtools.cpp 403 2011-08-06 17:36:22Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -19,7 +19,7 @@ /*! \file - \version $Id: $ + \version $Id: Rtools.cpp 403 2011-08-06 17:36:22Z mueller $ \brief Implemenation of Rtools . */ diff --git a/tools/src/librtools/Rtools.hpp b/tools/src/librtools/Rtools.hpp index 0af72c48..924b9044 100644 --- a/tools/src/librtools/Rtools.hpp +++ b/tools/src/librtools/Rtools.hpp @@ -1,4 +1,4 @@ -// $Id: $ +// $Id: Rtools.hpp 403 2011-08-06 17:36:22Z mueller $ // // Copyright 2011- by Walter F.J. Mueller // @@ -19,7 +19,7 @@ /*! \file - \version $Id: $ + \version $Id: Rtools.hpp 403 2011-08-06 17:36:22Z mueller $ \brief Declaration of class Rtools . */ diff --git a/tools/src/librutiltpp/Makefile b/tools/src/librutiltpp/Makefile index f9a3a9da..84ed8f3b 100644 --- a/tools/src/librutiltpp/Makefile +++ b/tools/src/librutiltpp/Makefile @@ -1,7 +1,9 @@ -# $Id: Makefile 372 2011-03-20 22:48:11Z mueller $ +# $Id: Makefile 401 2011-07-31 21:02:33Z mueller $ # # Revision History: # Date Rev Version Comment +# 2011-07-31 401 1.1 rename realclean->distclean +# 2011-07-01 386 1.0.2 add BOOSTINC # 2011-03-20 372 1.0.1 renamed ..tcl -> ..tpp # 2011-03-19 371 1.0 Initial version #--- @@ -14,7 +16,7 @@ SOMINV = 0 # # Compile and Link search paths # -INCLFLAGS = -I/usr/include/tcl8.4 -I${RETROBASE}/tools/src +INCLFLAGS = -I/usr/include/tcl8.4 -I${RETROBASE}/tools/src -I${BOOSTINC} LDLIBS = -L${RETROBASE}/tools/lib -lrtcltools # # Object files to be included @@ -39,7 +41,7 @@ include $(DEP_all) # # cleanup phonies: # -.PHONY : clean cleandep realclean +.PHONY : clean cleandep distclean clean : @ rm -f $(OBJ_all) @ echo "Object files removed" @@ -48,7 +50,7 @@ cleandep : @ rm -f $(DEP_all) @ echo "Dependency files removed" # -realclean : clean cleandep +distclean : clean cleandep @ rm -f $(SOPATH)/lib$(SONAME).a $(SOPATH)/lib$(SONAME).so* @ echo "Libraries removed" # diff --git a/tools/tcl/.tclshrc b/tools/tcl/.tclshrc index 873c187c..7d6575be 100644 --- a/tools/tcl/.tclshrc +++ b/tools/tcl/.tclshrc @@ -1,8 +1,10 @@ # -*- tcl -*- -# $Id: .tclshrc 376 2011-04-17 12:24:07Z mueller $ +# $Id: .tclshrc 379 2011-04-22 20:56:19Z mueller $ # -lappend auto_path [file join $env(RETROBASE) tools tcl] -lappend auto_path [file join $env(RETROBASE) tools lib] +if {[info exists env(RETROBASE)]} { + lappend auto_path [file join $env(RETROBASE) tools tcl] + lappend auto_path [file join $env(RETROBASE) tools lib] +} # if {$tcl_interactive} { package require tclreadline diff --git a/tools/tcl/.wishrc b/tools/tcl/.wishrc index 135389bd..2782ad1f 100644 --- a/tools/tcl/.wishrc +++ b/tools/tcl/.wishrc @@ -1,8 +1,10 @@ # -*- tcl -*- -# $Id: .wishrc 376 2011-04-17 12:24:07Z mueller $ +# $Id: .wishrc 379 2011-04-22 20:56:19Z mueller $ # -lappend auto_path [file join $env(RETROBASE) tools tcl] -lappend auto_path [file join $env(RETROBASE) tools lib] +if {[info exists env(RETROBASE)]} { + lappend auto_path [file join $env(RETROBASE) tools tcl] + lappend auto_path [file join $env(RETROBASE) tools lib] +} # if {$tcl_interactive} { package require tclreadline diff --git a/tools/tcl/rbs3hio/util.tcl b/tools/tcl/rbs3hio/util.tcl index 907e47b6..6a72faad 100644 --- a/tools/tcl/rbs3hio/util.tcl +++ b/tools/tcl/rbs3hio/util.tcl @@ -1,4 +1,4 @@ -# $Id: util.tcl 376 2011-04-17 12:24:07Z mueller $ +# $Id: util.tcl 406 2011-08-14 21:06:44Z mueller $ # # Copyright 2011- by Walter F.J. Mueller # @@ -13,6 +13,7 @@ # # Revision History: # Date Rev Version Comment +# 2011-08-14 406 1.0.2 adopt to common register layout # 2011-04-17 376 1.0.1 print: show also switch values; add proc disptest # 2011-03-27 374 1.0 Initial version # 2011-03-19 372 0.1 First draft @@ -27,8 +28,8 @@ namespace eval rbs3hio { # # setup register descriptions for s3_humanio_rbus # - regdsc CNTL {daten 11} {dpen 10} {leden 9} {swien 8} {btn 3 4} - regdsc LED {dp 11 4} {led 7 8} + regdsc CNTL {btn 12 4} {dspen 3} {dpen 2} {leden 1} {swien 0} + regdsc LED {dp 15 4} {led 7 8} # # setup: amap definitions for s3_humanio_rbus @@ -79,7 +80,7 @@ namespace eval rbs3hio { proc disptest {} { rlc exec -rreg hi.cntl r_cntl set swien [regget rbs3hio::CNTL(swien) $r_cntl] - rlc exec -wreg hi.cntl [regbld rbs3hio::CNTL daten dpen leden \ + rlc exec -wreg hi.cntl [regbld rbs3hio::CNTL dspen dpen leden \ [list swien $swien] ] foreach ledval {0x0f 0xf0 0xff} { diff --git a/tools/tcl/rlink/util.tcl b/tools/tcl/rlink/util.tcl index 86b878ec..e1440eb9 100644 --- a/tools/tcl/rlink/util.tcl +++ b/tools/tcl/rlink/util.tcl @@ -1,4 +1,4 @@ -# $Id: util.tcl 375 2011-04-02 07:56:47Z mueller $ +# $Id: util.tcl 403 2011-08-06 17:36:22Z mueller $ # # Copyright 2011- by Walter F.J. Mueller # @@ -13,6 +13,7 @@ # # Revision History: # Date Rev Version Comment +# 2011-08-06 403 1.0.1 add SINT and SINIT defs for serport init # 2011-03-26 373 1.0 Initial version # 2011-03-19 372 0.1 First draft # @@ -22,8 +23,9 @@ package provide rlink 1.0 package require rutil 1.0 namespace eval rlink { - regdsc STAT {stat 7 3} {attn 4} {cerr 3} {derr 2} {rbnak 1} {rberr 0} - regdsc INIT {anena 15} {itoena 14} {itoval 7 8} + regdsc STAT {stat 7 3} {attn 4} {cerr 3} {derr 2} {rbnak 1} {rberr 0} + regdsc INIT {anena 15} {itoena 14} {itoval 7 8} + regdsc SINIT {fena 12} {fwidth 11 3} {fdelay 8 3} {rtsoff 5 3} {rtson 2 3} # # 'pseudo register', describes 3rd word in return list element for -rlist regdsc FLAGS {vol 16} \ @@ -33,13 +35,15 @@ namespace eval rlink { {done 2} {send 1} {init 0} variable IINT 0x00ff + variable SINT 0x00fe # - # init: reset rlink (disable enables; clear attn register + # init: reset rlink: disable enables; clear attn register # proc init {} { rlc exec \ -init $rlink::IINT 0x0000 \ + -init $rlink::SINT [regbld rlink::SINIT {rtsoff 7} {rtson 6} ] \ -attn return "" } diff --git a/tools/tcl/setup_packages b/tools/tcl/setup_packages index 4d8c84b3..78179ea5 100755 --- a/tools/tcl/setup_packages +++ b/tools/tcl/setup_packages @@ -1,4 +1,5 @@ #! /usr/bin/env tclsh +# $Id: setup_packages 403 2011-08-06 17:36:22Z mueller $ # pkg_mkIndex -verbose ../lib libr*tpp.so #