Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
2bbfbeb4
Commit
2bbfbeb4
authored
6 years ago
by
Irina LEE
Browse files
Options
Downloads
Patches
Plain Diff
new files .h ans .cpp
parent
2fbad2f4
No related branches found
No related tags found
1 merge request
!72
Syscams
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SysCAMSGenerationCode/generated_CPP/distance_sensor.cpp
+28
-0
28 additions, 0 deletions
SysCAMSGenerationCode/generated_CPP/distance_sensor.cpp
SysCAMSGenerationCode/generated_H/analog_to_digital.h
+36
-0
36 additions, 0 deletions
SysCAMSGenerationCode/generated_H/analog_to_digital.h
with
64 additions
and
0 deletions
SysCAMSGenerationCode/generated_CPP/distance_sensor.cpp
0 → 100644
+
28
−
0
View file @
2bbfbeb4
#include
<systemc-ams>
#include
"analog_to_digital.h"
// Simulation entry point.
int
sc_main
(
int
argc
,
char
*
argv
[])
{
using
namespace
sc_core
;
using
namespace
sca_util
;
// Declare signal to interconnect.
// Instantiate source and sink as well as bind their ports to the signal.
analog_to_digital
analog_to_digital_1
(
"analog_to_digital_1"
);
analog_to_digital_1
.
sensorIn
(
// Configure signal tracing.
sca_trace_file
*
tfp
=
sca_create_tabular_trace_file
(
"distance_sensor_tb"
);
// Start simulation.
sc_start
(
100.0
,
SC_MS
);
// Close trace file and stop simulation to enable clean-up by
// asking SystemC to execute all end_of_simulation() callbacks.
sca_close_tabular_trace_file
(
tfp
);
sc_stop
();
return
0
;
}
This diff is collapsed.
Click to expand it.
SysCAMSGenerationCode/generated_H/analog_to_digital.h
0 → 100644
+
36
−
0
View file @
2bbfbeb4
#ifndef ANALOG_TO_DIGITAL_H
#define ANALOG_TO_DIGITAL_H
#include
<cmath>
#include
<iostream>
#include
<systemc-ams>
SCA_TDF_MODULE
(
analog_to_digital
)
{
// TDF port declarations
sca_tdf
::
sca_in
<
double
>
sensorIn
;
// Converter port declarations
sca_tdf
::
sca_de
::
sca_out
<
int
>
soclibOut
;
sca_tdf
::
sca_de
::
sca_in
<
int
>
soclibIn
;
// Constructor
SCA_CTOR
(
analog_to_digital
)
:
sensorIn
(
"sensorIn"
)
,
soclibOut
(
"soclibOut"
)
,
soclibIn
(
"soclibIn"
)
{}
void
set_attributes
()
{
sensorIn
.
set_rate
(
1
);
sensorIn
.
set_delay
(
0
);
soclibOut
.
set_rate
(
1
);
soclibOut
.
set_delay
(
0
);
soclibIn
.
set_rate
(
1
);
soclibIn
.
set_delay
(
0
);
}
void
processing
()
{
}
};
#endif // ANALOG_TO_DIGITAL_H
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment