2014-07-23 22:39:29 +02:00
|
|
|
#ifndef IVL_vhdlint_H
|
|
|
|
|
#define IVL_vhdlint_H
|
2011-02-11 18:16:40 +01:00
|
|
|
/*
|
2014-07-23 22:39:29 +02:00
|
|
|
* Copyright (c) 2011-2014 Stephen Williams (steve@icarus.com)
|
2011-02-11 18:16:40 +01:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-08-29 03:41:23 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2011-02-11 18:16:40 +01:00
|
|
|
*/
|
2011-02-04 17:51:51 +01:00
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
class vhdlint
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit vhdlint(const char* text);
|
|
|
|
|
explicit vhdlint(const int64_t& val);
|
|
|
|
|
explicit vhdlint(const vhdlint& val);
|
2011-03-03 05:23:02 +01:00
|
|
|
|
2011-02-04 17:51:51 +01:00
|
|
|
bool is_negative() const;
|
|
|
|
|
bool is_positive() const;
|
|
|
|
|
bool is_zero() const;
|
2011-03-03 05:23:02 +01:00
|
|
|
|
2011-02-04 17:51:51 +01:00
|
|
|
int64_t as_long() const;
|
|
|
|
|
//vhdlv get(const unsigned index) const;
|
|
|
|
|
//void set(const unsigned index, const unsigned val);
|
|
|
|
|
// unsigned short operator[](const unsigned index);
|
|
|
|
|
private:
|
|
|
|
|
int64_t value_;
|
|
|
|
|
};
|
|
|
|
|
|
2014-07-23 22:39:29 +02:00
|
|
|
#endif /* IVL_vhdlint_H */
|