Changeset 2134 for trunk


Ignore:
Timestamp:
May 23, 2012, 3:10:02 PM (7 years ago)
Author:
ksherdy
Message:

Added alignment assertion.

Location:
trunk/symbol_table
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/symbol_table/Makefile

    r2132 r2134  
    1414
    1515#PABLO_COMPILER=../../proto/Compiler/pablomain.py
    16 PABLO_COMPILER=Compiler/pablomain.py
     16PABLO_COMPILER=Compiler/pablomain.py 
    1717PABLO_ADD_DEBUG = #-a -b
    1818
  • trunk/symbol_table/group_strms_template.hpp

    r2097 r2134  
    33
    44#include "../lib/bitblock.hpp"
     5#include "../lib/bitblock_align.hpp"
    56#include "../lib/carryQ.hpp"
    67
  • trunk/symbol_table/hash_strms_template.hpp

    r1960 r2134  
    33
    44#include "../lib/bitblock.hpp"
     5#include "../lib/bitblock_align.hpp"
    56#include "../lib/carryQ.hpp"
    67#include "basis_bits.hpp"
  • trunk/symbol_table/main_template.cpp

    r2132 r2134  
    125125    ///////////////////////////////////////////////////////////////////////////
    126126    while (chars_avail >= SEGMENT_SIZE) {
     127cout << "A" << endl;
    127128        uint32_t blk;
    128129        for(blk=0;blk<SEGMENT_BLOCKS;blk++) {
     
    133134    }
    134135
     136cout << "B" << endl;
     137
    135138    for(int blk=0;blk<SEGMENT_BLOCKS;blk++) {   // write contiguous bit streams
    136139        h0[blk] = hash[blk].h0;
     
    144147    PERF_SEC_END(parser_timer, SEGMENT_SIZE);
    145148
     149cout << "C" << endl;
     150
    146151    COPY_BACK_BYTE_BUFFER(COPYBACK, src_buffer);
    147152    COPY_BACK_BITBLOCK_BUFFER(COPYBACK_h0,h0);
     
    150155    COPY_BACK_BITBLOCK_BUFFER(COPYBACK_follows_0,follows_0);
    151156
     157cout << "D" << endl;
     158
    152159    is.read ((char *)(src_buffer), SEGMENT_SIZE);
    153160    chars_avail = is.gcount();
     161
     162cout << "E" << endl;
    154163
    155164    #ifdef IDENTITY_TEST
     
    174183    #endif
    175184    }
     185
     186cout << "F" << endl;
    176187
    177188    /* Resolve Partial Segments */
     
    203214    }
    204215
     216cout << "G" << endl;
     217
    205218    uint32_t segment_blocks = blk;
    206219    for(int blk=0;blk<segment_blocks;blk++) { // write contiguous hash bit streams
     
    211224    }
    212225
     226cout << "H" << endl;
     227cout << segment_blocks << endl;
    213228    // PERF_SEC_BIND(0);
    214229    PERF_SEC_START(parser_timer);
    215230    st.resolve(src_buffer, groups, starts, follows_0, h0, h1, segment_blocks, gids);
    216     PERF_SEC_END(parser_timer, chars_avail+1);
     231    PERF_SEC_END(parser_timer, chars_avail);
     232
     233cout << "I" << endl;
    217234
    218235    #ifdef IDENTITY_TEST
  • trunk/symbol_table/marker_strms_template.hpp

    r2097 r2134  
    22#define MARKERS_TEMPLATE_HPP
    33#include "../lib/bitblock.hpp"
     4#include "../lib/bitblock_align.hpp"
    45#include "../lib/carryQ.hpp"
    56
  • trunk/symbol_table/src/buffer.hpp

    r2118 r2134  
    11#ifndef BUFFER_HPP
    22#define BUFFER_HPP
     3#include "../lib/bitblock.hpp"
     4
    35///////////////////////////////////////////////////////////////////////////
    46// Buffer Constants
     
    2729#define ALLOC_STATIC_ALIGNED_BYTE_BUFFER(copyback, base) \
    2830        BitBlock aligned_##base[BUFFER_SIZE]; \
     31        assert_bitblock_align((void*)aligned_##base);\
    2932        copyback = (uint8_t *)aligned_##base; \
    3033        memset(copyback,0,COPYBACK_SIZE); \
     
    3336#define ALLOC_STATIC_ALIGNED_BITBLOCK_BUFFER(copyback, base) \
    3437        BitBlock aligned_##base[BUFFER_SIZE/8]; \
     38        assert_bitblock_align((void*)aligned_##base);\
    3539        copyback = (BitBlock *) aligned_##base; \
    3640        memset(copyback,0,COPYBACK_SIZE/8); \
     
    3842
    3943#define COPY_BACK_BYTE_BUFFER(copyback, base) \
    40 do {    memmove(copyback,&((uint8_t *)base)[SEGMENT_SIZE-COPYBACK_SIZE],COPYBACK_SIZE);\
     44do {    memmove(copyback,(uint8_t *)base + (SEGMENT_SIZE - COPYBACK_SIZE), COPYBACK_SIZE);\
    4145} while(0)
    4246
  • trunk/symbol_table/src/symbol_table.hpp

    r2132 r2134  
    100100
    101101                        for(uint32_t blk = 0; blk < segment_blocks; blk++) {
     102cout << blk << endl;
    102103                                const uint32_t blk_offset = blk * BLOCK_SIZE;
    103104                                resolve(blk_offset, &buffer[blk_offset], groups[blk], &starts[blk], &h0[blk], &h1[blk], gids);
Note: See TracChangeset for help on using the changeset viewer.