Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributions related to Medium Article #11

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Converted test application to C++
  • Loading branch information
nowinnovation authored and nOw Innovation committed Jun 6, 2022
commit b06b225fb6b191db43a8b8df4dfa939966969bb3
7 changes: 7 additions & 0 deletions lib_jtag_core/src/bsdl_parser/bsdl_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
* @brief bsdl file parser header
* @author Jean-François DEL NERO <[email protected]>
*/
#ifdef __cplusplus
extern "C" {
#endif

#define MAX_ELEMENT_SIZE (64+1)

Expand Down Expand Up @@ -78,3 +81,7 @@ typedef struct _jtag_bsdl

jtag_bsdl * load_bsdlfile(jtag_core * jc,char *filename);
void unload_bsdlfile(jtag_core * jc, jtag_bsdl * bsdl);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions lib_jtag_core/src/bsdl_parser/bsdl_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
* @brief bsdl file string keywords header
* @author Jean-François DEL NERO <[email protected]>
*/
#ifdef __cplusplus
extern "C" {
#endif


typedef struct type_strings_
{
Expand Down Expand Up @@ -75,3 +79,7 @@ extern type_strings statetype_str[];
extern type_strings pintype_str[];

int get_typecode(type_strings * typelist,char * name);

#ifdef __cplusplus
}
#endif
7 changes: 7 additions & 0 deletions lib_jtag_core/src/jtag_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
* @brief Main jtag core library header
* @author Jean-François DEL NERO <[email protected]>
*/
#ifdef __cplusplus
extern "C" {
#endif

#ifndef _jtag_core_
typedef void jtag_core;
Expand Down Expand Up @@ -318,3 +321,7 @@ int jtagcore_execScriptRam( script_ctx * ctx, unsigned char * script_buffer, in
script_ctx * jtagcore_deinitScript( script_ctx * ctx );

int jtagcore_savePinsStateScript( jtag_core * jc, int device, char * script_path );

#ifdef __cplusplus
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ int main(int argc,char * argv[]) {
jtag_bsdl * details = load_bsdlfile(jc, argv[1]);
if ( details != NULL ) {
unsigned long id = details->chip_id;
int irLength = details->number_of_bits_per_instruction;
int irLength = details->number_of_bits_per_instruction;
if(irLength>0) {
printf("Chip ID %0lx OK: uses %i-bit OPCODES\r\n",id,irLength);
int chainCount = details->number_of_chainbits;
int pinCount = details->number_of_pins;
printf("Chip ID %0lx OK: uses %i-bit OPCODES\r\n",id,irLength);
printf("Chip ID %0lx OK: has %i pins with %i chains\r\n",id,pinCount,chainCount);

} else {
printf("BSDL file for chip ID %0lx has unsupported OPCODE length\r\n",id);
printf("BSDL file for chip ID %0lx has unsupported OPCODE length\r\n",id);
}
unload_bsdlfile(jc,details);
details = NULL;
Expand Down
4 changes: 2 additions & 2 deletions lib_jtag_core/test/linux/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CC ?= gcc
CC ?= g++
AR ?= ar

UNAME := $(shell uname)
Expand Down Expand Up @@ -29,7 +29,7 @@ endif

all: $(EXEC)

BSDLtoFloorplan: BSDLtoFloorplan.c
BSDLtoFloorplan: BSDLtoFloorplan.cpp
$(CC) -o $@ $^ $(CFLAGS) "$(LIBDIR)/$(LIB)"

clean:
Expand Down