Skip to content

Commit

Permalink
Fixed a few errors in the protobuf specification. Protobuf is now com…
Browse files Browse the repository at this point in the history
…piled and linked with libjtaghal, but not actually used for anything.
  • Loading branch information
azonenberg committed Aug 30, 2018
1 parent 1d994fb commit c383f4e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 30 deletions.
25 changes: 23 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
# CMake build script for jtaghal.
# Intended to be integrated into a larger project, not built standalone.

set(PROTOBUF_DIR ${CMAKE_BINARY_DIR}/protobufs)

set(PROTO_FILES
${CMAKE_CURRENT_SOURCE_DIR}/jtaghal-net.proto
)

add_custom_command(
OUTPUT ${PROTOBUF_DIR}/jtaghal/jtaghal-net.pb.cc ${PROTOBUF_DIR}/jtaghal/jtaghal-net.pb.h
COMMAND mkdir -p ${PROTOBUF_DIR}
COMMAND protoc --proto_path=${CMAKE_SOURCE_DIR}/lib --cpp_out=${PROTOBUF_DIR} ${PROTO_FILES}
COMMENT "Building protocol buffer"
DEPENDS ${PROTO_FILES}
)

# disable warnings in generated protobuf code
set_source_files_properties(${PROTOBUF_DIR}/jtaghal/jtaghal-net.pb.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)

include_directories(${PROTOBUF_DIR})

set(JTAGHAL_SOURCES
jtaghal.cpp

${PROTOBUF_DIR}/jtaghal/jtaghal-net.pb.cc

JtagException.cpp

FirmwareImage.cpp
Expand Down Expand Up @@ -83,8 +104,8 @@ set(JTAGHAL_SOURCES

add_library(jtaghal SHARED
${JTAGHAL_SOURCES})
target_link_libraries(jtaghal log)
target_link_libraries(jtaghal xptools)

target_link_libraries(jtaghal log xptools ${PROTOBUF_LIBRARIES})
if(FTD2XX_LIB)
target_link_libraries(jtaghal ftd2xx)
endif()
Expand Down
56 changes: 28 additions & 28 deletions jtaghal-net.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ message InfoRequest
{
enum InfoType
{
Name = 0,
Serial = 1,
Userid = 2,
Freq = 3,
GpioPresent = 4,
GpioCount = 5
HwName = 0;
HwSerial = 1;
Userid = 2;
Freq = 3;
GpioPresent = 4;
GpioCount = 5;
};

InfoType req = 1;
};

message InfoReply
{
optional string str = 1;
optional uint64 num = 2;
string str = 1;
uint64 num = 2;
};

//Flush buffers all the way down the pipe
message FlushRequest
{
//no content, opcode is all we need
//no content; opcode is all we need
};

//Tell the server we're leaving
message DisconnectRequest
{
//no content, opcode is all we need
//no content; opcode is all we need
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -57,29 +57,29 @@ message GpioPinState

message GpioBankState
{
repeated GpioPinState = 1;
repeated GpioPinState states = 1;
};

message GpioReadRequest
{
//no content, opcode is all we need
//no content; opcode is all we need
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// JTAG transport messages

message JtagSplitScanSupportedRequest
{
//no content, opcode is all we need
//no content; opcode is all we need
};

message JtagScanRequest
{
bool readRequested = 1; //true if we want data coming back from this scan transaction
uint32 totalLen = 2; //total number of TCK cycles to send
bool setTmsAtEnd = 3; //true to strobe TMS at end of the transaction
optional bytes writeData = 4; //if set, must be at least totalLen bits long
bool split = 5; //if set, do a split read-only or write-only transaction
bool readRequested = 1; //true if we want data coming back from this scan transaction
uint32 totalLen = 2; //total number of TCK cycles to send
bool setTmsAtEnd = 3; //true to strobe TMS at end of the transaction
bytes writeData = 4; //if set; must be at least totalLen bits long
bool split = 5; //if set; do a split read-only or write-only transaction
};

//only sent if readRequested is set in the matching JtagScanRequest
Expand All @@ -93,10 +93,10 @@ message JtagPerformanceRequest
{
enum PerfCounter
{
ShiftOps = 1,
DataBits = 2,
ModeBits = 3,
DummyClocks = 4
ShiftOps = 0;
DataBits = 1;
ModeBits = 2;
DummyClocks = 3;
};

PerfCounter req = 1;
Expand All @@ -106,12 +106,12 @@ message JtagStateChangeRequest
{
enum ChainState
{
TestLogicReset = 1,
EnterShiftIR = 2,
LeaveShiftIR = 3,
EnterShiftDR = 4,
LeaveShiftDR = 5,
ResetToIdle = 6,
TestLogicReset = 0;
EnterShiftIR = 1;
LeaveShiftIR = 2;
EnterShiftDR = 3;
LeaveShiftDR = 4;
ResetToIdle = 5;
};

ChainState nextstate = 1;
Expand Down

0 comments on commit c383f4e

Please sign in to comment.