C++ SystemC AMS中的跟踪信号问题

C++ SystemC AMS中的跟踪信号问题,c++,eclipse,cygwin,systemc,C++,Eclipse,Cygwin,Systemc,我在SystemC AMS中实现了一个正弦波发生器,并希望在特定时间段内可视化其输出。为此,我想创建一个vcd文件。发电机代码和主要功能如下所示。我的问题是vcd文件是空的。我做错了什么 main.cpp: #include <iostream> #include "systemc.h" #include "systemc-ams.h" #include "sin_source.h" int sc_main (int argc, char* argv[]) { std::c

我在SystemC AMS中实现了一个正弦波发生器,并希望在特定时间段内可视化其输出。为此,我想创建一个vcd文件。发电机代码和主要功能如下所示。我的问题是vcd文件是空的。我做错了什么

main.cpp:

#include <iostream>
#include "systemc.h"
#include "systemc-ams.h"
#include "sin_source.h"

int sc_main (int argc, char* argv[])
{
    std::cout << "Hello World" << std::endl;

    sca_tdf::sca_signal <double> out1;
    sin_source mySine("sine1");
    mySine.out(out1);

    sca_util::sca_trace_file *tf1= sca_util::sca_create_vcd_trace_file("sine_wave");
    sca_util::sca_trace(tf1, out1, "i'm_sine_1");

    sc_core::sc_start(10, sc_core::SC_MS);
    sca_util::sca_close_vcd_trace_file(tf1);

    return 0;
}
int sc_main (int argc, char* argv[])
{
    std::cout << "Hello World" << std::endl;

    sca_tdf::sca_signal <double> out1;
    sin_source mySine("sine1");
    mySine.out(out1);

    std::cout << "Hello World 2" << std::endl;

    sca_util::sca_trace_file *tf1= sca_util::sca_create_vcd_trace_file("sine_wave");

    std::cout << "Hello World 3" << std::endl;

    sca_util::sca_trace(tf1, out1, "sine");

    std::cout << "Hello World 4" << std::endl;

    sc_core::sc_start(10, sc_core::SC_MS);

    std::cout << "Hello World 5" << std::endl;

    sca_util::sca_close_vcd_trace_file(tf1);

    std::cout << "Hello World 6" << std::endl;

    return 0;
}

我无法重现这个问题。您是否在文本编辑器中打开该文件以检查它是否真的为空


我看到的可能有问题的问题是“以信号的名义(sca_util::sca_trace(tf1,out1,“I'm_sine_1”)”)-可能您的waveviewer不喜欢它。

也许您可以尝试在systemc ams论坛上问一个问题:尝试将您的信号重命名为不使用任何特殊字符的名称(例如,从中删除撇号)[i'm_sine_1])。我见过一些EDA工具无法处理类似的事情。重命名信号@rainer不起作用。请查看我的编辑。因此,我上面的代码为您生成了一个正弦波图?您是否使用eclipse/cygwin设置?
int sc_main (int argc, char* argv[])
{
    std::cout << "Hello World" << std::endl;

    sca_tdf::sca_signal <double> out1;
    sin_source mySine("sine1");
    mySine.out(out1);

    std::cout << "Hello World 2" << std::endl;

    sca_util::sca_trace_file *tf1= sca_util::sca_create_vcd_trace_file("sine_wave");

    std::cout << "Hello World 3" << std::endl;

    sca_util::sca_trace(tf1, out1, "sine");

    std::cout << "Hello World 4" << std::endl;

    sc_core::sc_start(10, sc_core::SC_MS);

    std::cout << "Hello World 5" << std::endl;

    sca_util::sca_close_vcd_trace_file(tf1);

    std::cout << "Hello World 6" << std::endl;

    return 0;
}
Hello World
Hello World 2
        SystemC 2.3.2-Accellera --- Jul 17 2018 16:06:04
        Copyright (c) 1996-2017 by all Contributors,
        ALL RIGHTS RESERVED


        SystemC AMS extensions 2.1.0-COSEDA Release date: 20160404
        Copyright (c) 2010-2014  by Fraunhofer-Gesellschaft IIS/EAS
        Copyright (c) 2015-2016  by COSEDA Technologies GmbH
        Licensed under the Apache License, Version 2.0


Hello World 3
Hello World 4

Info: SystemC-AMS: 
    1 SystemC-AMS modules instantiated
    1 SystemC-AMS views created
    1 SystemC-AMS synchronization objects/solvers instantiated


Info: SystemC-AMS: 
    1 dataflow clusters instantiated
      cluster 0:
        1 dataflow modules/solver, contains e.g. module: sine1
        1 elements in schedule list,  
        5 us cluster period, 
        ratio to lowest:  1              e.g. module: sine1
        ratio to highest: 1 sample time  e.g. module: sine1
        0 connections to SystemC de, 0 connections from SystemC de