Added code skeleton for JTAG target simulator "JIM" (disabled by default)
git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@931 b68d4a1b-bc3d-0410-92ed-d4ac073336b7master
parent
18fb90545d
commit
2b6e82c897
@ -0,0 +1,29 @@
|
||||
#
|
||||
# $Id: Makefile.am $
|
||||
#
|
||||
# Copyright (C) 2008 Kolja Waschk <kawk>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
include $(top_srcdir)/Makefile.rules
|
||||
|
||||
noinst_LIBRARIES = libjim.a
|
||||
|
||||
libjim_a_SOURCES = \
|
||||
tap.c
|
@ -0,0 +1,6 @@
|
||||
This directory contains source code that simulates various aspects of
|
||||
a target. It is mainly thought to assist in testing and debugging the
|
||||
rest of UrJTAG. The connection between UrJTAG and the code here is by
|
||||
means of special bus, cable or parport drivers.
|
||||
|
||||
|
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* $Id: $
|
||||
*
|
||||
* JTAG target simulator JIM "cable" driver
|
||||
*
|
||||
* Copyright (C) 2008 Kolja Waschk
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, 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 more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "sysdep.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "cable.h"
|
||||
#include "parport.h"
|
||||
#include "chain.h"
|
||||
|
||||
#include "generic.h"
|
||||
|
||||
#include <cmd.h>
|
||||
|
||||
int
|
||||
jim_cable_connect( char *params[], cable_t *cable )
|
||||
{
|
||||
if ( cmd_params( params ) < 1 ) {
|
||||
printf( _("not enough arguments!\n") );
|
||||
return 1;
|
||||
}
|
||||
|
||||
cable->chain = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
jim_cable_disconnect( cable_t *cable )
|
||||
{
|
||||
cable_done( cable );
|
||||
chain_disconnect( cable->chain );
|
||||
}
|
||||
|
||||
void
|
||||
jim_cable_free( cable_t *cable )
|
||||
{
|
||||
free( cable );
|
||||
}
|
||||
|
||||
void
|
||||
jim_cable_done( cable_t *cable )
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
jim_cable_init( cable_t *cable )
|
||||
{
|
||||
printf( _("JTAG target simulator JIM - work in progress!\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
jim_cable_clock( cable_t *cable, int tms, int tdi, int n )
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
jim_cable_get_tdo( cable_t *cable )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
jim_cable_get_trst( cable_t *cable )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
jim_cable_set_trst( cable_t *cable, int trst )
|
||||
{
|
||||
return jim_cable_get_trst( cable );
|
||||
}
|
||||
|
||||
static void
|
||||
jim_cable_help( const char *cablename )
|
||||
{
|
||||
printf( _(
|
||||
"Usage: cable %s\n"
|
||||
),
|
||||
cablename
|
||||
);
|
||||
}
|
||||
|
||||
cable_driver_t jim_cable_driver = {
|
||||
"JIM",
|
||||
N_("JTAG target simulator JIM"),
|
||||
jim_cable_connect,
|
||||
jim_cable_disconnect,
|
||||
jim_cable_free,
|
||||
jim_cable_init,
|
||||
jim_cable_done,
|
||||
jim_cable_clock,
|
||||
jim_cable_get_tdo,
|
||||
generic_transfer,
|
||||
jim_cable_set_trst,
|
||||
jim_cable_get_trst,
|
||||
jim_cable_help
|
||||
};
|
||||
|
Loading…
Reference in New Issue