Hello Benoit,
Generally the layer-2 switches have ASIC components with CAM memory to perform the frames forwarding
Correct.
Generally the layer-3 switches have ASIC components with TCAM memory to perform the packets forwarding
Correct.
Regarding CEF, 1) when running in software, the FIB and Adjacency tables are stored in RAM and processed by CPU, and 2) when running in hardware, the FIB and Adjacency tables are stored in TCAM and processed by ASIC
Almost correct. Even in case of hardware implementation, FIB would be in TCAM but the adjacency table would be in a standalone memory handled by the ASIC. Remember: CAM and TCAM work as rapid searching mechanisms, but they only produce a pointer to another table that holds the actual data that have been identified by the lookup.
Regarding the Fast Switching method, does the fast-switching cache could be like the CEF switching, stored either in RAM or in TCAM if the switch has TCAM capability ?
This is a very good question for which I frankly do not have an answer. Purely technically speaking, implementing fast switching in hardware is possible in theory, but I am not sure if Cisco ever had such products. Either way, the support for fast switching has been dropped for a number of years already.
Finally, regarding a practical point of view, do a Cisco Catalyst 3850, and Catalyst 4500 have ASIC and TCAM memory ? Only CAT 6500 and 7600 Series Routers and Switches seems to have TCAM.
Oh, every Catalyst switch has an ASIC and a CAM, very possibly even a TCAM even if does not perform routing. Even the old Catalyst 2950 switches that have truly been pure Layer2 switches had a TCAM already, since they supported IP ACLs on access ports, and IP ACL matching in hardware requires a TCAM already (pattern, mask) - a CAM would not be sufficient.
Feel welcome to ask further!
Best regards,
Peter