What is the hardest part of hardware engineering?
Not understanding the basics.
And by ‘basics’ i mean the c compilation process, build process, linking process, generation of files at every stage (.i, .s and .o) .
Not only it helps in debugging once you get the basics right. It also helps in understanding the code base for any design specifications. Seldom i have seen people having clarity on it.
Doesn’t matter if you’re a pre-silicon or post-silicon engineer. The build process shares a commonality in both of these domains. Giving a brief overview here for anyone who might be interested in understanding the process.
𝗕𝘂𝗶𝗹𝗱 𝗣𝗿𝗼𝗰𝗲𝘀𝘀 :
- Pre-Processing
- Parsing
- Producing object files
- Linking object files
- Producing final executable
- Post processing of final executable
𝗖𝗼𝗺𝗽𝗶𝗹𝗮𝘁𝗶𝗼𝗻 𝗦𝘁𝗮𝗴𝗲 𝗼𝗳 𝘁𝗵𝗲 𝗯𝘂𝗶𝗹𝗱:
.c(source file) → Pre-processor → .i file generated → Parser → code generator → .s file generated → Assembler → .o file generated
Assembler converts mnemonics to machine code.
𝗟𝗶𝗻𝗸𝗶𝗻𝗴 𝘀𝘁𝗮𝗴𝗲 𝗼𝗳 𝘁𝗵𝗲 𝗯𝘂𝗶𝗹𝗱:
.o and .a files → linker → debug file generated (.elf) → objcopy tool → .bin file generated (pure binary executable file)
The compilation process below as depicted by VLSI-Dev World is very useful for quick reference.
Hope this helps😊.
Follow me on Linked-In for best-in-class resources on VLSI, Machine Learning, Python, Data Science, Success and Inspiration.