summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/ifcompiler
diff options
context:
space:
mode:
authorCamVan Nguyen <ctnguyen@us.ibm.com>2012-01-31 23:26:38 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-02-07 11:40:32 -0600
commit7839259660f10f1b31db833fce37aa323e749f41 (patch)
tree522dcdc39a32916cffe62134e9ae63b5213f5084 /src/usr/hwpf/ifcompiler
parent29f47aee84ded4c6e59da561c2e9b6257590b31d (diff)
downloadblackbird-hostboot-7839259660f10f1b31db833fce37aa323e749f41.tar.gz
blackbird-hostboot-7839259660f10f1b31db833fce37aa323e749f41.zip
SCOM Initfile - Support for using a range of index's for an array attribute
Change-Id: I87a23905c877281037b8610b6400b828f0578bec Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/636 Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/ifcompiler')
-rwxr-xr-xsrc/usr/hwpf/ifcompiler/initCompiler.lex11
-rwxr-xr-xsrc/usr/hwpf/ifcompiler/initCompiler.y10
-rwxr-xr-xsrc/usr/hwpf/ifcompiler/initRpn.C146
-rwxr-xr-xsrc/usr/hwpf/ifcompiler/initRpn.H10
-rwxr-xr-xsrc/usr/hwpf/ifcompiler/initScom.C25
-rwxr-xr-xsrc/usr/hwpf/ifcompiler/initScom.H3
-rwxr-xr-xsrc/usr/hwpf/ifcompiler/initSymbols.C2
7 files changed, 175 insertions, 32 deletions
diff --git a/src/usr/hwpf/ifcompiler/initCompiler.lex b/src/usr/hwpf/ifcompiler/initCompiler.lex
index be59d834d..e1c2116ec 100755
--- a/src/usr/hwpf/ifcompiler/initCompiler.lex
+++ b/src/usr/hwpf/ifcompiler/initCompiler.lex
@@ -26,6 +26,7 @@
// camvanng 11/08/11 Added support for attribute enums
// camvanng 11/16/11 Support system & target attributes
// camvanng 12/12/11 Support multiple address ranges within a SCOM address
+// camvanng 01/20/12 Support for using a range of indexes for array attributes
// End Change Log *********************************************************************************/
/**
* @file initCompiler.lex
@@ -75,8 +76,8 @@ extern int yyline;
NEWLINE \n
FILENAME [A-Za-z][A-Za-z0-9_\.]*
-ID [A-Za-z][A-Za-z0-9_]*
-ID2 [A-Za-z][A-Za-z0-9_]*
+ID [A-Za-z][A-Za-z0-9_]*
+ID2 [A-Za-z][A-Za-z0-9_]*(\[[0-9]+(..[0-9]+)?(,[0-9]+(..[0-9]+)?)*\]){0,4}
ID3 [0-9]+[A-Za-z_]+[0-9]*
DIGIT [0-9]
COMMENT #.*\n
@@ -186,7 +187,7 @@ scom { BEGIN(scomop); oss.str(""); return INIT_SCOM; }
<scomcolname>{COMMENT} ++yyline;
<scomcolname>\n ++yyline;
-<scomcolname>{ID} {
+<scomcolname>{ID2} {
g_colstream.push_back(new std::ostringstream());
*(g_colstream.back()) << yytext;
}
@@ -195,7 +196,7 @@ scom { BEGIN(scomop); oss.str(""); return INIT_SCOM; }
<scomrow>{COMMENT} ++yyline;
<scomrow>{NEWLINE} ++yyline;
-<scomrow>[^,;\n#\{\}]+ push_col(yytext);
+<scomrow>([^,;\n#\{\}]+{ID2}*)+ push_col(yytext);
<scomrow>[,] ++g_scomcol;
<scomrow>[;] g_scomcol = 0;
<scomrow>[\}] {
@@ -255,7 +256,7 @@ END_INITFILE return INIT_ENDINITFILE;
<*>[\(] { ++g_paren_level; return yytext[0]; }
<*>[\)] { --g_paren_level; return yytext[0]; }
-<*>\[{MULTI_DIGIT}\] { yylval.str_ptr = new std::string(yytext); return ATTRIBUTE_INDEX; }
+<*>\[({MULTI_DIGIT}[,.]*)+\] { yylval.str_ptr = new std::string(yytext); return ATTRIBUTE_INDEX; }
<*>[\[\]\{\},:] {g_equation = false; return yytext[0]; }
diff --git a/src/usr/hwpf/ifcompiler/initCompiler.y b/src/usr/hwpf/ifcompiler/initCompiler.y
index 1bbc43220..168ec5628 100755
--- a/src/usr/hwpf/ifcompiler/initCompiler.y
+++ b/src/usr/hwpf/ifcompiler/initCompiler.y
@@ -24,7 +24,8 @@
// andrewg 09/19/11 Updates based on review
// camvanng 11/08/11 Added support for attribute enums
// andrewg 11/09/11 Refactor to use common include with hwp framework.
-// camvanng 12/12/11 Support multiple address ranges within a SCOM address
+// camvanng 12/12/11 Support multiple address ranges within a SCOM address
+// camvanng 01/20/12 Support for using a range indexes for array attributes
// End Change Log *********************************************************************************
/**
* @file initCompiler.y
@@ -110,7 +111,6 @@ int scom;
/* top is lowest precedent - done last */
-%left ATTRIBUTE_INDEX /* irrelevant precedence, but needed for clean compile */
%left INIT_LOGIC_OR
%left INIT_LOGIC_AND
%left '|' /* bitwise OR */
@@ -122,6 +122,7 @@ int scom;
%left '-' '+'
%left '*' '/' '%'
%right '!' '~' /* logic negation bitwise complement*/
+%left ATTRIBUTE_INDEX /* highest precedence */
/* bottom is highest precedent - done first */
@@ -191,12 +192,11 @@ scombody: scombodyline ';' {}
scombodyline: INIT_SCOMD ',' scomdrows {}
| INIT_BITS ',' bitsrows {}
| INIT_EXPR ',' exprrows { init::dbg << "Add col EXPR" << endl; current_scom->add_col("EXPR"); }
- | INIT_ID ',' idrows {
+ | INIT_ID ',' idrows {
current_scom->add_col(*($1));
init::dbg << "Add col " << *($1) << endl;
delete $1;
}
-
;
@@ -264,7 +264,7 @@ expr: INIT_INTEGER { $$= new init::Rpn($1,yyscomlist->get_s
| INIT_ID { $$= new init::Rpn(*($1),yyscomlist->get_symbols()); delete $1; }
| ATTRIBUTE_ENUM { $$= new init::Rpn((yyscomlist->get_symbols())->get_attr_enum_val(*($1)),yyscomlist->get_symbols()); delete $1; }
| INIT_INT64 { $$=new init::Rpn($1,yyscomlist->get_symbols()); }
- | expr ATTRIBUTE_INDEX { $1->push_array_index(*($2));}
+ | expr ATTRIBUTE_INDEX { $1->push_array_index(*($2)); delete $2; }
| expr INIT_LOGIC_OR expr { $$ = $1->push_merge($3,OR); }
| expr INIT_LOGIC_AND expr { $$ = $1->push_merge($3,AND); }
| expr INIT_EQ expr { $$ = $1->push_merge($3,EQ); }
diff --git a/src/usr/hwpf/ifcompiler/initRpn.C b/src/usr/hwpf/ifcompiler/initRpn.C
index 2c8c0dc90..50b197e7d 100755
--- a/src/usr/hwpf/ifcompiler/initRpn.C
+++ b/src/usr/hwpf/ifcompiler/initRpn.C
@@ -24,6 +24,7 @@
// camvanng 11/08/11 Added support for attribute enums
// andrewg 11/09/11 Multi-dimensional array and move to common fapi include
// camvanng 01/06/12 Support for writing an attribute to a SCOM register
+// camvanng 01/20/12 Support for using a range of indexes for array attributes
// End Change Log *********************************************************************************
/**
@@ -40,6 +41,8 @@
#include <stdexcept>
#include <fapiHwpInitFileInclude.H> // Requires file from hwpf
+extern void yyerror(const char * s);
+
using namespace init;
const char * OP_TXT[] =
@@ -71,7 +74,7 @@ std::string Rpn::cv_empty_str;
//-------------------------------------------------------------------------------------------------
Rpn::Rpn(uint32_t i_uint,Symbols * symbols) : iv_symbols(symbols)
-{ push_int(i_uint);}
+{ push_int(i_uint); }
//-------------------------------------------------------------------------------------------------
@@ -205,13 +208,77 @@ void Rpn::push_array_index(std::string &i_array_idx)
string l_idx = i_array_idx;
// strip of leading "[" and last "]"
l_idx = l_idx.substr(1,(l_idx.length() - 2));
- uint32_t l_array_val = atoi(l_idx.c_str());
+ uint32_t l_num_idx = 0;
+ std::vector<string> l_idxstr;
- uint32_t rpn_id = iv_symbols->find_numeric_array_lit(l_array_val,4);
- iv_rpnstack.push_back(rpn_id);
+ // find index strings in comma separated list and save in vector
+ size_t l_pos = 0;
+ l_pos = l_idx.find(',');
+ while(l_pos != string::npos)
+ {
+ l_idxstr.push_back(l_idx.substr(0, l_pos));
+ l_idx = l_idx.substr(l_pos+1);
+ l_pos = l_idx.find(',');
+ }
+
+ // Push back the original idx string or the last string in the list
+ l_idxstr.push_back(l_idx);
+
+ uint32_t l_array_val = 0, l_array_val2 = 0;
+ uint32_t rpn_id = 0;
+ for (size_t i = 0; i < l_idxstr.size(); i++)
+ {
+ //Is it a range?
+ l_pos = l_idxstr.at(i).find("..");
+ if (l_pos != string::npos)
+ {
+ l_array_val = atoi(l_idxstr.at(i).substr(0,l_pos).c_str());
+ l_array_val2 = atoi(l_idxstr.at(i).substr(l_pos + 2).c_str());
+ //printf("I>Rpn::push_array_index: %u..%u\n", l_array_val, l_array_val2);
+ if (l_array_val >= l_array_val2)
+ {
+ std::ostringstream oss;
+ oss << "Invalid attribute array index range: " << l_idxstr.at(i);
+ yyerror(oss.str().c_str());
+ }
- // printf("Array Index: %s decimal:%u rpn_id:0x%8X\n",l_idx.c_str(),l_array_val,rpn_id);
+ for (uint32_t val = l_array_val; val <= l_array_val2; val++)
+ {
+ l_num_idx++;
+ rpn_id = iv_symbols->find_numeric_array_lit(val,4);
+ iv_rpnstack.push_back(rpn_id);
+ //printf("Array Index: %u rpn_id:0x%8X\n", val, rpn_id);
+ }
+ }
+ else
+ {
+ l_num_idx++;
+ l_array_val = atoi(l_idxstr.at(i).c_str());
+ rpn_id = iv_symbols->find_numeric_array_lit(l_array_val,4);
+ iv_rpnstack.push_back(rpn_id);
+
+ //printf("Array Index: %s decimal:%u rpn_id:0x%8X\n",l_idxstr.at(i).c_str(),l_array_val,rpn_id);
+ }
+ }
+
+ // Save the index range for this rpn
+ if (iv_array_idx_range.size())
+ {
+ if (iv_array_idx_range.back() != l_num_idx)
+ {
+ std::ostringstream oss;
+ oss << "Array attribute has different range of index for each dimension: "
+ << i_array_idx << " iv_array_idx_range: " << iv_array_idx_range.back()
+ << " l_num_idx: " << l_num_idx;
+ yyerror(oss.str().c_str());
+ }
+ }
+ else
+ {
+ iv_array_idx_range.push_back(l_num_idx);
+ }
+ //printf("Rpn::push_array_index: %s, iv_array_idx_range.size %u\n", i_array_idx.c_str(), iv_array_idx_range.size());
}
//-------------------------------------------------------------------------------------------------
@@ -284,11 +351,13 @@ Rpn * Rpn::push_merge(Rpn * i_rpn, IfRpnOp op)
if(this->isTrue())
{
iv_rpnstack.clear();
+ iv_array_idx_range.clear();
return merge(i_rpn); // merge deletes i_rpn
}
if(i_rpn->isFalse() || this->isFalse())
{
iv_rpnstack.clear();
+ iv_array_idx_range.clear();
delete i_rpn;
push_op(FALSE_OP);
return result;
@@ -304,11 +373,13 @@ Rpn * Rpn::push_merge(Rpn * i_rpn, IfRpnOp op)
if(this->isFalse())
{
iv_rpnstack.clear();
+ iv_array_idx_range.clear();
return merge(i_rpn); // merge deletes i_rpn
}
if(i_rpn->isTrue() || this->isTrue())
{
iv_rpnstack.clear();
+ iv_array_idx_range.clear();
delete i_rpn;
push_op(TRUE_OP);
return result;
@@ -327,6 +398,7 @@ Rpn * Rpn::push_merge(Rpn * i_rpn, IfRpnOp op)
if((op == EQ && *i_rpn == r2) || (op == NE && *i_rpn == r3))
{
iv_rpnstack.clear();
+ iv_array_idx_range.clear();
push_op(TRUE_OP);
delete i_rpn;
return result;
@@ -334,6 +406,7 @@ Rpn * Rpn::push_merge(Rpn * i_rpn, IfRpnOp op)
if((op == EQ && *i_rpn == r3) || (op == NE && *i_rpn == r2))
{
iv_rpnstack.clear();
+ iv_array_idx_range.clear();
push_op(FALSE_OP);
delete i_rpn;
return result;
@@ -467,6 +540,10 @@ Rpn * Rpn::push_merge(Rpn * i_rpn, IfRpnOp op)
//dg003a end
iv_rpnstack.insert(iv_rpnstack.end(), i_rpn->iv_rpnstack.begin(), i_rpn->iv_rpnstack.end());
+ for (size_t i = 0; i < i_rpn->iv_array_idx_range.size(); i++)
+ {
+ iv_array_idx_range.push_back(i_rpn->iv_array_idx_range.at(i));
+ }
result = push_op(op);
delete i_rpn;
@@ -479,6 +556,10 @@ Rpn * Rpn::push_merge(Rpn * i_rpn, IfRpnOp op)
Rpn * Rpn::merge(Rpn * i_rpn)
{
iv_rpnstack.insert(iv_rpnstack.end(), i_rpn->iv_rpnstack.begin(), i_rpn->iv_rpnstack.end());
+ for (size_t i = 0; i < i_rpn->iv_array_idx_range.size(); i++)
+ {
+ iv_array_idx_range.push_back(i_rpn->iv_array_idx_range.at(i));
+ }
delete i_rpn;
return this;
}
@@ -492,6 +573,7 @@ void Rpn::bin_read(BINSEQ::const_iterator & bli, Symbols * symbols)
if(symbols) iv_symbols = symbols;
iv_rpnstack.clear();
+ iv_array_idx_range.clear();
while(size)
{
@@ -568,6 +650,10 @@ BINSEQ::const_iterator Rpn::bin_read_one_op(BINSEQ::const_iterator & bli, Symbol
void Rpn::append(const Rpn & i_rpn)
{
iv_rpnstack.insert(iv_rpnstack.end(), i_rpn.iv_rpnstack.begin(), i_rpn.iv_rpnstack.end());
+ for (size_t i = 0; i < i_rpn.iv_array_idx_range.size(); i++)
+ {
+ iv_array_idx_range.push_back(i_rpn.iv_array_idx_range.at(i));
+ }
}
//-------------------------------------------------------------------------------------------------
@@ -692,11 +778,13 @@ std::string Rpn::listing(const char * i_desc, const std::string & spyname, bool
//-------------------------------------------------------------------------------------------------
-void Rpn::bin_str(BINSEQ & o_blist, bool i_prepend_count) // binary version to write to file
+// binary version to write to file
+void Rpn::bin_str(BINSEQ & o_blist, uint32_t i_num_addrs, uint32_t i_addr_num, bool i_prepend_count)
{
BINSEQ blist;
uint32_t count = 0;
-
+ uint32_t l_num_idx = 0; //number of array index in the range
+ uint32_t l_num_array_attrs = 0;
for(RPNSTACK::iterator i = iv_rpnstack.begin(); i != iv_rpnstack.end(); ++i)
{
@@ -713,24 +801,68 @@ void Rpn::bin_str(BINSEQ & o_blist, bool i_prepend_count) // binary version to
++count;
blist.push_back((uint8_t)(v >> 8));
}
+ l_num_idx = 0; //reset
break;
case SYMBOL: tag = iv_symbols->get_tag(v);
blist.push_back((uint8_t)(tag >> 8));
blist.push_back((uint8_t) tag);
count += 2;
+ l_num_idx = 0; //reset
break;
case NUMBER: tag = iv_symbols->get_numeric_tag(v);
blist.push_back((uint8_t)(tag >> 8));
blist.push_back((uint8_t) tag);
count += 2;
+ l_num_idx = 0; //reset
break;
case ARRAY_INDEX:
+ //Check if this rpn has any array attribute with a range of index specified
+ if ((0 == l_num_idx) && iv_array_idx_range.size())
+ {
+ if (iv_array_idx_range.size() > l_num_array_attrs)
+ {
+ l_num_idx = iv_array_idx_range.at(l_num_array_attrs);
+ l_num_array_attrs++;
+
+ //Error if index range is not equal to address range
+ if ((1 < l_num_idx) && (l_num_idx != i_num_addrs))
+ {
+ std::ostringstream errss;
+ errss << "Rpn::bin_str: Index range " << l_num_idx
+ << " != Address range " << i_num_addrs << endl;
+ throw std::invalid_argument(errss.str());
+ }
+ }
+ }
+
+ if (0 == l_num_idx)
+ {
+ //Error if no index range specified
+ std::ostringstream errss;
+ errss << "Rpn::bin_str: No index range specified for array attribute\n";
+ throw std::invalid_argument(errss.str());
+ }
+
+ if (1 < l_num_idx)
+ {
+ v = *(i + i_addr_num);
+ if ((v & TYPE_MASK) != ARRAY_INDEX)
+ {
+ std::ostringstream errss;
+ errss << "Rpn::bin_str: Rpn is not array index " << endl;
+ throw std::invalid_argument(errss.str());
+ }
+ }
tag = iv_symbols->get_numeric_array_tag(v);
blist.push_back((uint8_t)(tag >> 8));
blist.push_back((uint8_t) tag);
count += 2;
+ if (1 < l_num_idx) //Skip the other indexes in the range
+ {
+ i += l_num_idx - 1;
+ }
break;
default:
diff --git a/src/usr/hwpf/ifcompiler/initRpn.H b/src/usr/hwpf/ifcompiler/initRpn.H
index 5eba73c62..1965603b2 100755
--- a/src/usr/hwpf/ifcompiler/initRpn.H
+++ b/src/usr/hwpf/ifcompiler/initRpn.H
@@ -24,8 +24,9 @@
// dg002 SW039868 dgilbert 10/15/10 Add support to filter unneeded inits by EC
// dg003 SW047506 dgilbert 12/09/10 SERIES filtering
// andrewg 09/19/11 Updates based on review
-// camvanng 11/08/11 Added support for attribute enums
+// camvanng 11/08/11 Added support for attribute enums
// andrewg 11/09/11 Multi-dimensional array and move to common fapi include
+// camvanng 01/20/12 Support for using a range of indexes for array attributes
// End Change Log *********************************************************************************
/**
@@ -178,12 +179,15 @@ namespace init
* @brief Push all RPN stack entries of object as numerical values onto input blist
*
* @param blist Binary string of RPN to write to file
+ * @param i_num_addrs number of Scom addresses for this Scom
+ * @param i_addr_num the nth addr with the range of Scom addresses
* @param i_prepend_count Flag to indicate prepend rpn count to binary string
* @PRE should never be called until all symbols in the initfile have been
* "looked up" or the binary tags for Symbols and Numbers may not be accurate
* @return void
*/
- void bin_str(BINSEQ & blist, bool i_prepend_count = false);
+ void bin_str(BINSEQ & blist, uint32_t i_num_addrs, uint32_t i_addr_num,
+ bool i_prepend_count = false);
/**
* Read binary sequence to recreate this Rpn sequence
@@ -262,9 +266,11 @@ namespace init
private: // types and data
typedef std::vector<uint32_t> RPNSTACK;
+ typedef std::vector<uint32_t> INDEXRANGE;
RPNSTACK iv_rpnstack; ///< Rpn sequence
Symbols * iv_symbols; ///< Symbol table to use
+ INDEXRANGE iv_array_idx_range; ///< indicates range of indexes for an array attribute
diff --git a/src/usr/hwpf/ifcompiler/initScom.C b/src/usr/hwpf/ifcompiler/initScom.C
index 583c082e1..a8cf2dd9d 100755
--- a/src/usr/hwpf/ifcompiler/initScom.C
+++ b/src/usr/hwpf/ifcompiler/initScom.C
@@ -28,6 +28,7 @@
// camvanng 12/12/11 Support multiple address ranges within a SCOM address
// Use strtoull vs strtoul for 32-bit platforms
// camvanng 12/15/11 Support for multiple duplicate addresses setting different bits
+// camvanng 01/20/12 Support for using a range of indexes for array attributes
// End Change Log *********************************************************************************
/**
@@ -440,6 +441,7 @@ uint32_t Scom::bin_listing(BINSEQ & blist)
{
set<RANGE> ranges;
uint32_t scom_count = 0;
+ uint32_t addr_num = 0;
row_optimize(); // delete any rows that are unconditionally false. + merge rows
@@ -447,7 +449,7 @@ uint32_t Scom::bin_listing(BINSEQ & blist)
SCOM_ADDR::iterator i = iv_scom_addr.begin();
- for(; i != iv_scom_addr.end(); ++i)
+ for(; i != iv_scom_addr.end(); ++i, ++addr_num)
{
//printf("scom address:%s\n",(*i).c_str());
if(ranges.size())
@@ -461,16 +463,16 @@ uint32_t Scom::bin_listing(BINSEQ & blist)
// - Recreate the spy from the bytecode
// - Compile the recreated spy back into bytecode.
BINSEQ temp;
- bin_list_one(temp,strtoull((*i).c_str(),NULL,16), *r);
+ bin_list_one(temp,strtoull((*i).c_str(),NULL,16), addr_num, *r);
BINSEQ::const_iterator bi = temp.begin();
Scom s(bi,iv_symbols);
- s.bin_list_one(blist,strtoull((*i).c_str(),NULL,16), RANGE(1,0));
+ s.bin_list_one(blist,strtoull((*i).c_str(),NULL,16), addr_num, RANGE(1,0));
}
}
else
{
++scom_count;
- bin_list_one(blist,strtoull((*i).c_str(),NULL,16), RANGE(1,0));
+ bin_list_one(blist,strtoull((*i).c_str(),NULL,16), addr_num, RANGE(1,0));
}
}
@@ -479,9 +481,10 @@ uint32_t Scom::bin_listing(BINSEQ & blist)
//-------------------------------------------------------------------------------------------------
-void Scom::bin_list_one(BINSEQ & blist,uint64_t i_addr, RANGE range)
+void Scom::bin_list_one(BINSEQ & blist,uint64_t i_addr, uint32_t i_addr_num, RANGE range)
{
+ uint32_t numaddrs = iv_scom_addr.size(); //Number of Scom addresses for this Scom
uint32_t numcols = iv_col_vars.size() | (iv_when & SUBTYPE_MASK); // WHEN subtype goes in numcols
// No range support
@@ -553,7 +556,7 @@ void Scom::bin_list_one(BINSEQ & blist,uint64_t i_addr, RANGE range)
//Rpn::set32(blist,(uint32_t)iv_address);
Rpn *l_scom_addr = new init::Rpn(i_addr,yyscomlist->get_symbols());
- l_scom_addr->bin_str(blist,false);
+ l_scom_addr->bin_str(blist,numaddrs,i_addr_num,false);
delete l_scom_addr;
@@ -568,7 +571,7 @@ void Scom::bin_list_one(BINSEQ & blist,uint64_t i_addr, RANGE range)
{
if ((*r) == range)
{
- i->bin_str(blist,false);
+ i->bin_str(blist,numaddrs,i_addr_num,false);
}
}
}
@@ -576,14 +579,14 @@ void Scom::bin_list_one(BINSEQ & blist,uint64_t i_addr, RANGE range)
{
for(RPN_LIST::iterator i = iv_scom_rpn.begin(); i != iv_scom_rpn.end(); ++i)
{
- i->bin_str(blist,false);
+ i->bin_str(blist,numaddrs,i_addr_num,false);
}
}
// list the column names that are really CINI VARS
for(RPN_LIST::iterator i = iv_col_vars.begin(); i != iv_col_vars.end(); ++i)
{
- i->bin_str(blist,false); // false means don't prepend an RPN byte count to the binary rpn appended.
+ i->bin_str(blist,numaddrs,i_addr_num,false); // false means don't prepend an RPN byte count to the binary rpn appended.
//uint16_t tag = iv_symbols->get_tag(*i);
//blist.push_back((uint8_t)(tag >> 8));
//blist.push_back((uint8_t) tag);
@@ -605,7 +608,7 @@ void Scom::bin_list_one(BINSEQ & blist,uint64_t i_addr, RANGE range)
{
rpn.append(i->at(n));
}
- rpn.bin_str(blist,true);
+ rpn.bin_str(blist,numaddrs,i_addr_num,true);
}
}
}
@@ -1050,7 +1053,7 @@ void ScomList::compile(BINSEQ & bin_seq)
}
else // syntax version already validated to be 1 or 2 - so if we get here it was never set.
{
- throw range_error("ERROR: No sytax version specified!");
+ throw range_error("ERROR: No syntax version specified!");
}
stats << '*' << setw(20) << "Syntax Version:" << setw(6) << iv_syntax_version << endl;
diff --git a/src/usr/hwpf/ifcompiler/initScom.H b/src/usr/hwpf/ifcompiler/initScom.H
index eebbb2513..efdd0d235 100755
--- a/src/usr/hwpf/ifcompiler/initScom.H
+++ b/src/usr/hwpf/ifcompiler/initScom.H
@@ -28,6 +28,7 @@
// camvanng 12/12/11 Support multiple address ranges within a SCOM address
// Use strtoull vs strtoul for 32-bit platforms
// camvanng 12/15/11 Support for multiple duplicate addresses setting different bits
+// camvanng 01/20/12 Support for using a range of indexes for array attributes
// End Change Log *********************************************************************************
/**
@@ -179,7 +180,7 @@ namespace init
private: // functions
string list_one(RANGE range);
- void bin_list_one(BINSEQ & blist,uint64_t i_addr, RANGE range);
+ void bin_list_one(BINSEQ & blist,uint64_t i_addr, uint32_t i_addr_num, RANGE range);
/**
* Optimize the row RPNs
diff --git a/src/usr/hwpf/ifcompiler/initSymbols.C b/src/usr/hwpf/ifcompiler/initSymbols.C
index 156d021dc..68e18f01c 100755
--- a/src/usr/hwpf/ifcompiler/initSymbols.C
+++ b/src/usr/hwpf/ifcompiler/initSymbols.C
@@ -177,7 +177,7 @@ Symbols::Symbols(FILELIST & i_filenames)
else
{
attr_enum_stream >> tmp;
- value = strtoll(tmp.c_str(), NULL, 0);
+ value = strtoull(tmp.c_str(), NULL, 0);
}
}
}
OpenPOWER on IntegriCloud