Using IXP2400/2800 Development Tools: A Hands-on Approach to Network Processor Software Design

The trouble with programmers is that you can never tell what a programmer is doing until it's too late.
Seymour Cray
This chapter covers the basics of writing microcode, the assembly language of the microengine. You learn how the Assembler works and what it does for you. You also learn the syntax of the microcode file, including preprocessor directives, register naming, and some coding guidelines to keep you out of trouble. From reading this chapter, you'll know how to write macros and instructions that move data around the IXP2XXX network processors. You'll also know the instruction set categories and syntax with a neat two-page summary of the instruction set. Because your job is to write a driver for receiving packets, you use the task diagram generated by your architect to write key code segments that touch the hardware, writing CSRs, allocating a buffer, transferring packet data from the MSF (media switch fabric) to DRAM, and sending messages to the IP stack through a scratch ring. You configure the Assembler build parameters and run the Assembler in the Developer Workbench. You also run the Assembler standalone from the command line. This chapter contains tips for writing more efficient and maintainable code. For additional information, refer to the programmer's reference manual (Intel 2004) and the user's guide for the development tools (Intel 2004). You can find other good examples of application development in the programming guide (Johnson and Kunze 2003).
If you are an...