A method for protecting a bus which connects a first master interface provided between a first bus master and a slave interface provided between a bus slave and the bus, and which connects a second master interface provided between a second bus master and the slave interface, the method comprising the steps of:
- (1) outputting, from the first bus master, a first data generated based on a first protocol,
- (2) generating by the first master interface, first copy data by copying the first data,
- (3) generating, by the first master interface, first error detection code based on the first copy data, and adding a first protocol identifier representing the first protocol used in the first bus master to the first copy data,
- (4) generating, by a first protocol conversion unit in the bus, the second data by converting the first data from the first protocol to a second protocol,
- (5) outputting, from the bus, the second data, the first copy data, the first error detection code, and the first protocol identifier to the slave interface,
- (6) detecting, by the slave interface, an error in the first copy data based on the first error detection code,
- (7) generating, by the slave interface, first verification data by converting one of the second data and the first copy data from one of the first protocol and the second protocol to another one of the first protocol and the second protocol,
- (8) comparing, by the slave interface, the first verification data with second verification data that is another one of the second data and the first copy data, and
- (9) outputting, from the second bus master, third data generated based on a third protocol,
- (10) generating, by the second master interface, second copy data by copying the third data,
- (11) generating by, the second master interface, second error detection code based on the second copy data, and adding a second protocol identifier representing the third protocol used in the second bus master to the second copy data, the third protocol being different from the first protocol,
- (12) generating, by a second protocol conversion unit in the bus, fourth data by converting the third data from the third protocol to the second protocol,
- (13) outputting, from the bus, the fourth data, the second copy data, and the second error detection code, and the second protocol identifier to the slave interface,
- (14) detecting, by the slave interface, an error in the second copy data based on the second error detection code,
- (15) generating, by the slave interface, third verification data by converting one of the fourth data and the second copy data from one of the third protocol and the second protocol to another one of the third protocol or the second protocol, and
- (16) comparing, by the slave interface, the third verification data with fourth verification data that is another one of the fourth data and the second copy data, and
- (17) selecting, by a selector, one of the first verification data and the third verification data for the comparing by the slave interface based on the first and second protocol identifiers added to the first and second copy data, respectively.