According to Hindu legend, a pregnant woman named Rathnavathi was an ardent devotee of Shiva. While nearing labor, she requested her mother to come over. Her mom could not reach on account of heavy floods in river Cauvery. As delivery time came closer, Rathnavathi prayed to Shiva. Shiva, moved by the devotion of Rathnavathi, took the form of Rathnavathi's mother and helped with her smooth delivery. After the delivery, Shiva vanished and Rathnavathi's mother arrived later.
The family learned that it was Shiva who attended to the delivery. Henceforth, Shiva in the temple came to be known as Thayumanaswamy, meaning the Lord who acted like a Mother. The temple obtained the name from the presiding deity, Thayumanaswamy.Shiva disguised himself as a mother for a pregnant lady, leading to the name Thayumanavar, meaning the one who became a mother.

Thayumanaswamy Temple at Trichy
According to Hindu mythology, the city Tiruchirappalli derives its name from legend associated with the Thayumanaswamy temple. The three-headed demon Trishira, who meditated on Thayumanavar near the present-day city to obtain favours from the god.
An alternative derivation, not universally accepted, is that the source of the city's name is the Sanskrit word "Trishirapuram"—Trishira, meaning "three-headed", and palli or puram meaning "city".
As per another legend, due to a fight between Adisesha (serpent god) and Vayu (Wind god) to seek ownership of Himalayas, the eight pieces of the mountain fell to eight different places. One of them was Trincomalee in Sri Lanka, Srikalahasti at Andhra Pradesh and Rockfort. The place became known as Trisikarapuram as there are three peaks in the temple, one each for Shiva, Parvathi and Ganesha.

Shrine of Mattuvar Kuzhalammai
Tiruchirapalli was a capital of the Chola kingdom and it houses a number of exquisitely sculpted temples and fortresses, the centre of which is the Rockfort temple. The temple is built in the Dravidian style of architecture;
The rock-cut cave temples of the Rockfort, along with the gateway and the Erumbeeswarar Temple, are listed as monuments of national importance by the Archaeological Survey of India
The Rockfort is a fortress which stands atop a 273-foot-high rock. It consists of a set of monolithic rocks accommodating many rock-cut cave temples. Originally built by the Pallavas, it was later reconstructed by the Madurai Nayaks and Vijayanagara rulers
The major complex in the temple are believed to be built during the 8th century by the Pandyan Empire.
The temple is maintained and administered by the Hindu Religious and Charitable Endowments Department of the Government of Tamil Nadu.