Print clear message when mis-used in synthesis

This closes #3.
This commit is contained in:
Yuanjie Huang 2019-02-27 15:32:16 +08:00
parent 0d857f63a9
commit 742e07391d
7 changed files with 21 additions and 19 deletions

View file

@ -22,10 +22,12 @@
// Forward declaration of all AP types.
#include <ap_decl.h>
// Automatically enable half if FPO exists
#if ! defined _AP_ENABLE_HALF_ && defined __SIM_FPO__
#define _AP_ENABLE_HALF_ 1
#endif
#ifdef __SYNTHESIS__
#error "The open-source version of AP types does not support synthesis."
#endif // ifdef __SYNTHESIS__
#define _AP_ENABLE_HALF_ 0
#if _AP_ENABLE_HALF_ == 1
// Before ap_private definition.
@ -191,9 +193,7 @@ struct remove_const<_Tp const> {
// ----------------------------------------------------------------------
// Define ssdm_int and _ssdm_op.
#ifdef __SYNTHESIS__
#error "This header does not sypport synthesis"
#endif // ifdef __SYNTHESIS__
// XXX deleted in open-source version
#ifndef NON_C99STRING
#define _AP_C99 true

View file

@ -18,9 +18,7 @@
#define __AP_FIXED_BASE_H__
#ifndef __AP_FIXED_H__
// TODO make this an error
#pragma message \
"Only ap_fixed.h and ap_int.h can be included directly in user code."
#error "Only ap_fixed.h and ap_int.h can be included directly in user code."
#endif
// for ap_int_base and its reference types.

View file

@ -18,9 +18,7 @@
#define __AP_FIXED_REF_H__
#ifndef __AP_FIXED_H__
// TODO make this an error
#pragma message \
"Only ap_fixed.h and ap_int.h can be included directly in user code."
#error "Only ap_fixed.h and ap_int.h can be included directly in user code."
#endif
#ifndef __cplusplus

View file

@ -16,6 +16,11 @@
#ifndef __AP_FIXED_SPECIAL_H__
#define __AP_FIXED_SPECIAL_H__
#ifndef __AP_FIXED_H__
#error "Only ap_fixed.h and ap_int.h can be included directly in user code."
#endif
#ifndef __SYNTHESIS__
#include <cstdio>
#include <cstdlib>

View file

@ -18,9 +18,7 @@
#define __AP_INT_BASE_H__
#ifndef __AP_INT_H__
// TODO make this an error
#pragma message \
"Only ap_fixed.h and ap_int.h can be included directly in user code."
#error "Only ap_fixed.h and ap_int.h can be included directly in user code."
#endif
#ifndef __cplusplus

View file

@ -18,9 +18,7 @@
#define __AP_INT_REF_H__
#ifndef __AP_INT_H__
// TODO make this an error
#pragma message \
"Only ap_fixed.h and ap_int.h can be included directly in user code."
#error "Only ap_fixed.h and ap_int.h can be included directly in user code."
#endif
#ifndef __cplusplus

View file

@ -16,6 +16,11 @@
#ifndef __AP_INT_SPECIAL_H__
#define __AP_INT_SPECIAL_H__
#ifndef __AP_INT_H__
#error "Only ap_fixed.h and ap_int.h can be included directly in user code."
#endif
#ifndef __SYNTHESIS__
#include <cstdio>
#include <cstdlib>