提交 5a685b4d 编写于 作者: 饶先宏's avatar 饶先宏

202105201746

上级 5b61d24f
......@@ -51,13 +51,13 @@ typedef struct sIBigNumber {
OBJECT_INTERFACE
int (*GetBitsCount)(HOBJECT object);
int (*GetInt)(HOBJECT object, int* pvaue);
int (*GetInt64)(HOBJECT object, long long* pvaue);
int (*GetFloat)(HOBJECT object, float* pvaue);
int (*GetDouble)(HOBJECT object, double* pvaue);
int (*GetStr)(HOBJECT object, int base, char * str, int strlen);
int (*GetInt)(HOBJECT object, int* pvalue);
int (*GetInt64)(HOBJECT object, long long* pvalue);
int (*GetFloat)(HOBJECT object, float* pvalue);
int (*GetDouble)(HOBJECT object, double* pvalue);
int (*GetStr)(HOBJECT object, int base, char * str, int buflen);
int (*AssignStr)(HOBJECT object, const char * str);
int (*AssignStr)(HOBJECT object, const char * str, const char ** nstr);
int (*AssignInt)(HOBJECT object, int value);
int (*AssignInt64)(HOBJECT object, long long value);
int (*AssignFloat)(HOBJECT object, float value);
......@@ -88,22 +88,22 @@ typedef struct sIBigNumber {
int (*IsLT)(HOBJECT object, HOBJECT src);
}IBigNumber;
#define HDL4SEUNIT_VARDECLARE
#define HDL4SEUNIT_VARINIT(_objptr, _sid)
#define HDL4SEUNIT_FUNCDECLARE(_obj, _clsid, _localstruct) \
static int _obj##_bn_GetBitsCount)(HOBJECT object); \
static int _obj##_bn_GetInt(HOBJECT object, int* pvaue); \
static int _obj##_bn_GetInt64(HOBJECT object, long long* pvaue); \
static int _obj##_bn_GetFloat(HOBJECT object, float* pvaue); \
static int _obj##_bn_GetDouble(HOBJECT object, double* pvaue); \
static int _obj##_bn_GetStr(HOBJECT object, int base, char* str, int strlen); \
static int _obj##_bn_AssignStr(HOBJECT object, const char* str); \
#define BIGNUMBER_VARDECLARE
#define BIGNUMBER_VARINIT(_objptr, _sid)
#define BIGNUMBER_FUNCDECLARE(_obj, _clsid, _localstruct) \
static int _obj##_bn_GetBitsCount(HOBJECT object); \
static int _obj##_bn_GetInt(HOBJECT object, int* pvalue); \
static int _obj##_bn_GetInt64(HOBJECT object, long long* pvalue); \
static int _obj##_bn_GetFloat(HOBJECT object, float* pvalue); \
static int _obj##_bn_GetDouble(HOBJECT object, double* pvalue); \
static int _obj##_bn_GetStr(HOBJECT object, int base, char* str, int buflen); \
static int _obj##_bn_AssignStr(HOBJECT object, const char* str, const char ** nstr); \
static int _obj##_bn_AssignInt(HOBJECT object, int value); \
static int _obj##_bn_AssignInt64(HOBJECT object, long long value); \
static int _obj##_bn_AssignFloat(HOBJECT object, float value); \
static int _obj##_bn_AssignDouble(HOBJECT object, double value); \
static int _obj##_bn_Assign(HOBJECT object, HOBJECT src);\
static int _obj##_bn_Assign(HOBJECT object, HOBJECT src); \
static int _obj##_bn_Neg(HOBJECT object); \
static int _obj##_bn_AddInt(HOBJECT object, int value); \
static int _obj##_bn_Add(HOBJECT object, HOBJECT src); \
......@@ -156,6 +156,11 @@ typedef struct sIBigNumber {
_obj##_bn_IsLT \
};
DEFINE_GUID(CLSID_BIGINTEGER, 0xabde0235, 0x8f00, 0x4f30, 0x92, 0xbf, 0x95, 0x2e, 0x35, 0x8b, 0x1a, 0xeb);
IBigNumber** bigintegerCreate();
#endif /* _ASMLANGUAGE */
#ifdef __cplusplus
......
......@@ -39,4 +39,593 @@
#include "object.h"
#define IMPLEMENT_GUID
#include "bignumber.h"
#undef IMPLEMENT_GUID
\ No newline at end of file
#undef IMPLEMENT_GUID
typedef struct _sBigInteger {
OBJECT_HEADER
INTERFACE_DECLARE(IBigNumber)
BIGNUMBER_VARDECLARE
int buflen;
int sign;
unsigned int* buf;
}sBigInteger;
OBJECT_FUNCDECLARE(bigint, CLSID_BIGINTEGER);
BIGNUMBER_FUNCDECLARE(bigint, CLSID_BIGINTEGER, sBigInteger);
OBJECT_FUNCIMPL(bigint, sBigInteger, CLSID_BIGINTEGER);
QUERYINTERFACE_BEGIN(bigint, CLSID_BIGINTEGER)
QUERYINTERFACE_ITEM(IID_BIGNUMBER, IBigNumber, sBigInteger)
QUERYINTERFACE_END
static const char* bigintModuleInfo()
{
return "1.0.0-20210520.1355 Big integer library";
}
static int bigintCreate(const PARAMITEM* pParams, int paramcount, HOBJECT* pObject)
{
sBigInteger* pobj;
pobj = (sBigInteger*)malloc(sizeof(sBigInteger));
if (pobj == NULL)
return -1;
*pObject = 0;
BIGNUMBER_VARINIT(pobj, CLSID_BIGINTEGER);
INTERFACE_INIT(IBigNumber, pobj, bigint, bn);
pobj->sign = 0;
pobj->buflen = 2;
pobj->buf = malloc(pobj->buflen * sizeof(unsigned int));
pobj->buf[0] = pobj->buf[1] = 0;
/* 返回生成的对象 */
OBJECT_RETURN_GEN(bigint, pobj, pObject, CLSID_BIGINTEGER);
return EIID_OK;
}
static int actualwidth(unsigned int n)
{
unsigned int c = 1;
int ret = 1;
if (c & 0x80000000)
return 32;
while (c < n) {
c <<= 1;
ret++;
}
return ret;
}
static void bigintDestroy(HOBJECT object)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
free(pobj->buf);
free(pobj);
}
static int bigintValid(HOBJECT object)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
if (pobj == NULL)
return 0;
if (pobj->buflen < 2)
return 0;
if (pobj->buf == NULL)
return 0;
return 1;
}
static int bigint_bn_GetBitsCount(HOBJECT object)
{
int i;
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
for (i = pobj->buflen - 1; i >= 0; i--) {
if (pobj->buf[i] != 0) {
return i * 32 + actualwidth(pobj->buf[i]);
}
}
return 0;
}
static int bigint_bn_GetInt(HOBJECT object, int* pvalue)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
*pvalue = pobj->buf[0];
if (pobj->sign)
*pvalue = -(*pvalue);
return 0;
}
static int bigint_bn_GetInt64(HOBJECT object, long long* pvalue)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
*pvalue = (long long)pobj->buf[0];
if (pobj->buflen >= 2) {
long long temp;
temp = pobj->buf[1];
temp <<= 32;
*pvalue += temp;
}
if (pobj->sign)
*pvalue = -(*pvalue);
return 0;
}
static int bigint_bn_GetFloat(HOBJECT object, float* pvalue)
{
return 0;
}
static int bigint_bn_GetDouble(HOBJECT object, double* pvalue)
{
return 0;
}
static int bigint_bn_GetStr(HOBJECT object, int base, char* str, int buflen)
{
int i;
int bc, ac;
char fmt[10];
char buf[10];
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
str[0] = 0;
bc = bigint_bn_GetBitsCount(object);
sprintf(str, "%d'h", bc);
i = ((bc + 31) / 32) - 1;
ac = actualwidth(pobj->buf[i]);
ac = (ac + 7) / 8;
sprintf(fmt, "%%%dx_", ac);
sprintf(buf, fmt, pobj->buf[i]);
strcat(str, buf);
for (i = ((bc + 31) / 32)-2; i >= 0; i--) {
sprintf(buf, "%08x", pobj->buf[i]);
strcat(str, buf);
if (i > 0)
strcat(str, "_");
}
return 0;
}
enum TOKEN_STATE {
TOKEN_INITIAL,
TOKEN_NUM,
TOKEN_BASE,
TOKEN_BIN,
TOKEN_OCT,
TOKEN_DEC,
TOKEN_HEX
};
static int bigint_bn_AssignStr(HOBJECT object, const char* str, const char **nstr)
{
enum TOKEN_STATE state;
const char* strt = str;
int numvalid = 0;
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
state = TOKEN_INITIAL;
*nstr = strt;
while (*strt != 0) {
int ch = *strt;
switch (state) {
case TOKEN_INITIAL: {
if (ch == '\'') {
state = TOKEN_BASE;
}
else if (ch >= '0' && ch <= '9') {
bigint_bn_AssignInt(object, ch - '0');
numvalid = 1;
state = TOKEN_NUM;
}
} break;
case TOKEN_NUM: {
if (ch >= '0' && ch <= '9') {
bigint_bn_MulInt(object, 10);
bigint_bn_AddInt(object, ch - '0');
}
else if (ch == '\'') {
state = TOKEN_BASE;
numvalid = 0;
}
else {
goto lastnum;
}
}break;
case TOKEN_BASE: {
if (ch == 'b' || ch == 'B') {
bigint_bn_AssignInt(object, 0);
state = TOKEN_BIN;
}
else if (ch == 'h' || ch == 'H') {
bigint_bn_AssignInt(object, 0);
state = TOKEN_HEX;
}
else if (ch == 'o' || ch == 'O') {
bigint_bn_AssignInt(object, 0);
state = TOKEN_OCT;
}
else if (ch == 'd' || ch == 'D') {
bigint_bn_AssignInt(object, 0);
state = TOKEN_DEC;
}
else if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n') {
}
else {
return -1;
}
}break;
case TOKEN_BIN: {
if (ch == '0' || ch == '1') {
bigint_bn_MulInt(object, 2);
bigint_bn_AddInt(object, ch - '0');
numvalid = 1;
}
else if (ch == '_') {
}
else {
goto lastnum;
}
}break;
case TOKEN_OCT: {
if (ch >= '0' && ch <= '7') {
bigint_bn_MulInt(object, 8);
bigint_bn_AddInt(object, ch - '0');
numvalid = 1;
}
else if (ch == '_') {
}
else {
goto lastnum;
}
}break;
case TOKEN_DEC: {
if (ch >= '0' && ch <= '9') {
bigint_bn_MulInt(object, 10);
bigint_bn_AddInt(object, ch - '0');
numvalid = 1;
}
else {
goto lastnum;
}
}break;
case TOKEN_HEX: {
if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F')) {
numvalid = 1;
bigint_bn_MulInt(object, 16);
if (ch > '0' && ch <= '9')
bigint_bn_AddInt(object, ch - '0');
else if (ch >= 'a' && ch <= 'f')
bigint_bn_AddInt(object, ch - 'a' + 10);
else if (ch >= 'A' && ch <= 'F')
bigint_bn_AddInt(object, ch - 'A' + 10);
}
else if (ch == '_') {
}
else {
goto lastnum;
}
}break;
}
strt++;
}
if (numvalid == 0)
return -1;
lastnum:
*nstr = strt;
return 0;
}
static int bigint_bn_AssignInt(HOBJECT object, int value)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
if (value < 0) {
pobj->sign = 1;
value = -value;
} else {
pobj->sign = 0;
}
memset(pobj->buf, 0, pobj->buflen * sizeof(unsigned int));
pobj->buf[0] = value;
return 0;
}
static int bigint_bn_AssignInt64(HOBJECT object, long long value)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
if (value < 0) {
pobj->sign = 1;
value = -value;
}
else {
pobj->sign = 0;
}
memset(pobj->buf, 0, pobj->buflen * sizeof(unsigned int));
pobj->buf[0] = value & 0xFFFFFFFF;
pobj->buf[1] = value >> 32;
return 0;
}
static int bigint_bn_AssignFloat(HOBJECT object, float value)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_AssignDouble(HOBJECT object, double value)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_Assign(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
sBigInteger* psrc;
unsigned int* buf;
pobj = (sBigInteger*)objectThis(object);
if (!objectIsClass(src, CLSID_BIGINTEGER)) {
return -1;
}
psrc = (sBigInteger*)objectThis(src);
buf = (unsigned int*)malloc(psrc->buflen * sizeof(unsigned int));
if (buf == NULL)
return -2;
free(pobj->buf);
pobj->buf = buf;
memcpy(pobj->buf, psrc->buf, psrc->buflen * sizeof(unsigned int));
pobj->buflen = psrc->buflen;
pobj->sign = psrc->sign;
return 0;
}
static int bigint_bn_Neg(HOBJECT object)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
pobj->sign = 1 - pobj->sign;
return 0;
}
static int bigint_expandbuf(sBigInteger* pobj)
{
unsigned int* buf;
buf = (unsigned int*)malloc(pobj->buflen * 2 * sizeof(unsigned int));
if (buf == NULL)
return -1;
memcpy(buf, pobj->buf, pobj->buflen * sizeof(unsigned int));
memset(&buf[pobj->buflen], 0, pobj->buflen * sizeof(unsigned int));
free(pobj->buf);
pobj->buf = buf;
pobj->buflen *= 2;
return 0;
}
static int bigint_bn_AddInt(HOBJECT object, int value)
{
int vsign;
long long temp;
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
if (value >= 0) {
vsign = 0;
} else {
vsign = 1;
value = -value;
}
temp = pobj->buf[0];
if (vsign == pobj->sign) {
int i;
temp = temp + value;
pobj->buf[0] = temp & 0xffffffff;
temp >>= 32;
i = 1;
/* 处理进位 */
while (temp != 0) {
if (i >= pobj->buflen) {
if (0 != bigint_expandbuf(pobj))
return -1;
}
temp += pobj->buf[i];
pobj->buf[i] = temp & 0xffffffff;
temp >>= 32;
i++;
}
} else {
int bc = bigint_bn_GetBitsCount(object);
if (bc <= 32) {
if (pobj->buf[0] < value) {
pobj->sign = 1 - pobj->sign;
pobj->buf[0] = value - pobj->buf[0];
} else {
pobj->buf[0] -= value;
}
} else {
int borrow;
int i;
borrow = 0;
temp = pobj->buf[0];
if (temp < value) {
temp += 1ll << 32;
borrow = 1;
}
i = 1;
temp -= value;
pobj->buf[0] = temp & 0xffffffff;
/* 处理借位 */
while (borrow) {
if (pobj->buf[i] == 0) {
i++;
} else {
pobj->buf[i]--;
borrow = 0;
}
}
}
}
return 0;
}
static int bigint_bn_Add(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_SubInt(HOBJECT object, int value)
{
return bigint_bn_AddInt(object, -value);
}
static int bigint_bn_Sub(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_MulInt(HOBJECT object, int value)
{
long long addin, mulr;
int vsign;
int i;
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
if (value >= 0) {
vsign = 0;
} else {
vsign = 1;
value = -value;
}
pobj->sign = (vsign == pobj->sign) ? 0 : 1;
addin = 0;
for (i = 0; i < pobj->buflen; i++) {
mulr = value;
mulr *= pobj->buf[i];
mulr += addin;
pobj->buf[i] = mulr & 0xffffffff;
addin = mulr >> 32;
}
if (addin != 0) {
if (0 != bigint_expandbuf(pobj))
return -1;
pobj->buf[i] = addin & 0xffffffff;
}
return 0;
}
static int bigint_bn_Mul(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_DivInt(HOBJECT object, int value)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_Div(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_SHL(HOBJECT object, int bits)
{
sBigInteger* pobj;
int bc;
pobj = (sBigInteger*)objectThis(object);
bc = bigint_bn_GetBitsCount(object);
while (bc + bits > pobj->buflen * 32) {
if (bigint_expandbuf(pobj) != 0)
return -1;
}
/* fixed me */
return 0;
}
static int bigint_bn_SHR(HOBJECT object, int bits)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_And(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_Or(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_IsZero(HOBJECT object)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_IsNeg(HOBJECT object)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_IsEQ(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_IsLE(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
static int bigint_bn_IsLT(HOBJECT object, HOBJECT src)
{
sBigInteger* pobj;
pobj = (sBigInteger*)objectThis(object);
return 0;
}
IBigNumber** bigintegerCreate()
{
int ret;
IBigNumber** bn;
A_u_t_o_registor_bigint();
ret = objectCreateEx(CLSID_BIGINTEGER, NULL, 0, IID_BIGNUMBER, (const void**)&bn);
return bn;
}
......@@ -4,4 +4,5 @@
cmake_minimum_required (VERSION 3.8)
add_subdirectory ("counter")
add_subdirectory ("testbignumber")
\ No newline at end of file
# CMakeList.txt: 顶层 CMake 项目文件,在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)
add_executable (testbignumber "testbignumber.c")
target_link_libraries(testbignumber lcom bignumber)
include_directories("../../../lcom/include")
include_directories("../../hdl4sesim/include")
include_directories("../../hdl4secell/include")
include_directories("../../preprocess/include")
include_directories("../../bignumber/include")
include_directories("../counter/include")
include_directories("../../../glfw/include")
include_directories("../../../glfw/deps")
/*
** HDL4SE: 软件Verilog综合仿真平台
** Copyright (C) 2021-2021, raoxianhong<raoxianhong@163.net>
** LCOM: 轻量级组件对象模型
** Copyright (C) 2021-2021, raoxianhong<raoxianhong@163.net>
** 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.
** * The name of the author may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS BE
** 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.
*/
#include "stdlib.h"
#include "stdio.h"
#include "object.h"
#include "bignumber.h"
const char* testnumber = "43, 4, 128'b0101011111011010100011000101010101010100010101010101010001, 'h94397afc4343, 5'd98";
int main(int argc, char* argv[])
{
char buf[128];
IBigNumber** bignumber = bigintegerCreate();
const char* nstr = testnumber;
const char* lstr = testnumber;
while (0 == objectCall2(bignumber, AssignStr, lstr, &nstr)) {
objectCall3(bignumber, GetStr, 16, buf, 128);
printf("%s=%s, \nnext=%s\n", lstr, buf, nstr);
lstr = nstr;
}
return 0;
}
\ No newline at end of file
......@@ -164,18 +164,6 @@ DEFINE_GUID(CLSID_HDL4SE_MODULE,0x167d115e, 0x0c1e, 0x484e, 0x8b, 0xf3, 0xa7, 0x
*/
IHDL4SEUnit** hdl4seCreateUnit(IHDL4SEModule** parent, IIDTYPE clsid, char* instanceparam, char* name);
/*
下面是支持函数
*/
/*
把一个"7691029B-DAE3-4AC9-9A81-411C1B529039"格式的IID转换成一个IIDTYPE
返回值:
0 -- 成功
否则 -- 格式不对
*/
int str2iid(const char* str, IIDTYPE iid);
/*
从字符串中解析下一个数字,数字是verilog数字格式, 自动跳过开始的非数字字符
str: 字符串,
......
......@@ -60,33 +60,6 @@ IHDL4SEUnit** hdl4seCreateUnit(IHDL4SEModule** parent, IIDTYPE clsid, char* inst
return result;
}
/*
把一个"7691029B-DAE3-4AC9-9A81-411C1B529039"格式的IID转换成一个IIDTYPE
返回值:
0 -- 成功
否则 -- 格式不对
*/
int str2iid(const char* str, IIDTYPE iid)
{
unsigned int L;
unsigned int s[2];
unsigned int b[8];
if (sscanf_s(str, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", &L, &s[0], &s[1],
&b[0], &b[1], &b[2], &b[3], &b[4], &b[5], &b[6], &b[7]) != 11)
return -1;
#define IMPLEMENT_GUID
#include "guid.h"
{
DEFINE_GUID(temp, L, s[0], s[1], b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
iid[0] = temp[0];
iid[1] = temp[1];
iid[2] = temp[2];
iid[3] = temp[3];
}
#undef IMPLEMENT_GUID
return 0;
}
/*
从字符串中解析下一个数字,数字是verilog数字格式, 自动跳过开始的非数字字符
str: 字符串
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册