feiwu, What device are you writing to. 24C32 or similar?
I am not familiar with the opencores i2c module, but I know I2c eeproms well.
Are you allowing time between your write cycles. If you write your data in separate bus cycles (i.e. start-transactions-stop), then the device will detach itself from the I2C bus until it has completed its memory write cycle. You must wait until this is complete before writing the next byte. This can be done in 2 ways:
1. pause or sleep for the manufactures maximum specified time period (typically around 10mS).
2. attempt to address the device until it returns an acknowledge (called acknowledge polling).
1 is the easiest to implement but 2 is more time efficient because the true time can be much less than the worst-case time.
You can also write up to 32 bytes at once provided the address locations are all within the same page boundary (i.e. address bit 5 upwards are the same), but you must still perform the above wait afterwards.