[Who are the Computer Architects?]https://people.cs.clemson.edu/~mark/architects.html
The Mathematical Theory of Communication
Given a symbol level, the architecture is the description of the system in whatever system-description scheme exists next below the symbol level. - Newell, 1990, p. 81
Digital Design and Computer Architecture 2nd Edition
Computer Organization and Design 5th Edition
Structured Computer Organization 6th Edition
Write Great Code: Volume 1: Understanding the Machine
Microarchitectural state, such as information stored in TLBs and caches
A Symbolic Analysis of Relay and Switching Circuits
ISA: memory model, registers, data types, instructions, word size(?).
Memory model: unit of address resolution, word, aligment, address space, addressing mode, memory barrier/memory order primitive’s semantics.
Data struct alignment
Reasons for not alignment
- Casting variables to types of different lengths, e.g. char * to int *
Pointer arithmetic followed by access to at least 2 bytes of data , 不太理解.
Reorder members of struct;
get/put_unaligned to avoid analigned access.
Calculate the sizeof of aligned c struct
Data alignment means putting the data at a memory address equal to some multiple of the word size, which increases the system’s performance due to the way the CPU handles memory.
find the widest scalar member and attribute( aligned(x)) to determin alignment.
fill the member to alignement without wrap
Pading to alignment
Endianess and bitfield
The order of allocation of bit-fields within a unit
It’s Determined by ABI not Gcc. Check comments on Bitfield endianness in gcc
version:4; # MSB, check wikipeida ipv4 header
GCC bug on bitfield
Check books COD, COA and ULK 3rd