add codegen, ringbuffer sample