Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5e9203b56715
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8eaa5612f3ad
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Jul 25, 2020

  1. Copy the full SHA
    fa8e12c View commit details

Commits on Jul 26, 2020

  1. Copy the full SHA
    8eaa561 View commit details
Showing with 122 additions and 1 deletion.
  1. +1 −0 CMakeLists.txt
  2. +1 −1 lib
  3. +19 −0 src/examples/ibistest/CMakeLists.txt
  4. +101 −0 src/examples/ibistest/main.cpp
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ if(NOT WIN32)
add_subdirectory("${PROJECT_SOURCE_DIR}/src/reflowmon")
add_subdirectory("${PROJECT_SOURCE_DIR}/src/examples/curvetrace")
add_subdirectory("${PROJECT_SOURCE_DIR}/src/examples/fgtest")
add_subdirectory("${PROJECT_SOURCE_DIR}/src/examples/ibistest")
endif()

set_property(TARGET scopehal PROPERTY POSITION_INDEPENDENT_CODE ON)
2 changes: 1 addition & 1 deletion lib
Submodule lib updated from de1bc0 to 209e5a
19 changes: 19 additions & 0 deletions src/examples/ibistest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Set up include paths
include_directories(${GTKMM_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS})
link_directories(${GTKMM_LIBRARY_DIRS} ${SIGCXX_LIBRARY_DIRS})

###############################################################################
#C++ compilation
add_executable(ibistest
main.cpp
)

###############################################################################
#Linker settings
target_link_libraries(ibistest
scopehal
scopeprotocols
${GTKMM_LIBRARIES}
${SIGCXX_LIBRARIES}
)

101 changes: 101 additions & 0 deletions src/examples/ibistest/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/***********************************************************************************************************************
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
* following conditions are met: *
* *
* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
* following disclaimer. *
* *
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
* following disclaimer in the documentation and/or other materials provided with the distribution. *
* *
* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
***********************************************************************************************************************/

/**
@file
@author Andrew D. Zonenberg
@brief Program entry point
*/

#include "../scopehal/scopehal.h"

using namespace std;

int main(int argc, char* argv[])
{
Severity console_verbosity = Severity::NOTICE;

//Parse command-line arguments
string hostname;
for(int i=1; i<argc; i++)
{
string s(argv[i]);

//Let the logger eat its args first
if(ParseLoggerArguments(i, argc, argv, console_verbosity))
continue;

if(s == "--help")
{
//not implemented
return 0;
}
else if(s == "--host")
hostname = argv[++i];
else
{
fprintf(stderr, "Unrecognized command-line argument \"%s\", use --help\n", s.c_str());
return 1;
}
}

//Set up logging
g_log_sinks.emplace(g_log_sinks.begin(), new ColoredSTDLogSink(console_verbosity));

//Load the IBIS file
IBISParser ibis;
ibis.Load("/nfs4/share/datasheets/Xilinx/7_series/kintex-7/kintex7.ibs");
/*LogDebug("IBIS file loaded! Component is %s by %s\n",
ibis.m_component.c_str(),
ibis.m_manufacturer.c_str());*/

//Look up one particular I/O standard
auto model = ibis.m_models["LVDS_HP_O"];
if(!model)
LogFatal("couldn't find model\n");

//Run the simulation
auto waveform = model->SimulatePRBS(
CORNER_TYP,
5, //200 Gsps
20000,
160 //1.25 Gbps
);

//Print out the waveform
LogDebug("time, voltage\n");
for(size_t i=0; i<waveform->m_samples.size(); i++)
{
LogDebug("%f, %f\n", i*0.005, (double)waveform->m_samples[i]);
}
delete waveform;


return 0;
}